Logo white

Anubis / Anubis

Sign in
  • Sign in
  • Project
  • Files
  • Commits
  • Network
  • Graphs
  • Milestones
  • Issues 0
  • Merge Requests 0
  • Labels
  • Wiki
  • anubis
  • anubis_dev
  • library
  • test
  • hostname.c
  • first commit of the anubis 1.19.3 based on Alain version and the merge with the version 1.14
    54916ef7
    David RENÉ authored
    2021-01-02 14:33:21 +0900  
    Browse Code »
hostname.c 247 Bytes
Edit Raw Blame History
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18



#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <limits.h>

int main(void) {
  char hostname[HOST_NAME_MAX + 1];
  gethostname(hostname, HOST_NAME_MAX + 1);

  printf("hostname: %s\n", hostname);

  return EXIT_SUCCESS;
}