Back to index

glibc  2.9
gethostid.c File Reference
#include <unistd.h>
#include <hurd.h>
#include "hurdhost.h"

Go to the source code of this file.


long int gethostid ()

Function Documentation

long int gethostid ( )

Definition at line 25 of file gethostid.c.

  /* The hostid is just the contents of the file /etc/hostid,
     kept as text of hexadecimal digits.  */
  /* XXX this is supposed to come from the hardware serial number */
  char buf[8];
  ssize_t n = _hurd_get_host_config ("/etc/hostid", buf, sizeof buf);
  if (n < 0)
    return -1;
  return strtol (buf, NULL, 16);

Here is the call graph for this function: