machine, as returned by
.BR gethostbyname (3),
and thus usually never needs to be set.
-
+.PP
The
.BR sethostid ()
call is restricted to the superuser.
.BR gethostid ()
returns the 32-bit identifier for the current host as set by
.BR sethostid ().
-
+.PP
On success,
.BR sethostid ()
returns 0; on error, \-1 is returned, and
.BR sethostid ()
T} Thread safety MT-Unsafe const:hostid
.TE
-
+.sp 1
.SH CONFORMING TO
4.2BSD; these functions were dropped in 4.4BSD.
SVr4 includes
.BR gethostid ()
but not
.BR sethostid ().
-
+.PP
POSIX.1-2001 and POSIX.1-2008 specify
.BR gethostid ()
but not
.I /var/adm/hostid
was used.)
.\" libc5 used /etc/hostid; libc4 didn't have these functions
-
+.PP
In the glibc implementation, if
.BR gethostid ()
cannot open the file containing the host ID,