1GETHOSTID(2) Linux Programmer's Manual GETHOSTID(2)
2
3
4
6 gethostid, sethostid - get or set the unique identifier of the current
7 host
8
10 #include <unistd.h>
11
12 long gethostid(void);
13 int sethostid(long hostid);
14
16 Get or set a unique 32-bit identifier for the current machine. The
17 32-bit identifier is intended to be unique among all UNIX systems in
18 existence. This normally resembles the Internet address for the local
19 machine, as returned by gethostbyname(3), and thus usually never needs
20 to be set.
21
22 The sethostid() call is restricted to the superuser.
23
24 The hostid argument is stored in the file /etc/hostid.
25
27 gethostid() returns the 32-bit identifier for the current host as set
28 by sethostid(2).
29
31 4.2BSD; these functions were dropped in 4.4BSD. SVr4 includes geth‐
32 ostid() but not sethostid(). POSIX.1-2001 specifies gethostid() but
33 not sethostid().
34
36 /etc/hostid
37
39 hostid(1), gethostbyname(3)
40
41
42
43Linux 0.99.13 1993-11-29 GETHOSTID(2)