gethostid.3: Before version 2.2, glibc stored the host ID in /var/adm/hostid

Also: rewrite some text describing the /etc/hostid file, so that
this location is referred to just once on the page.

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
This commit is contained in:
Michael Kerrisk 2009-01-13 07:43:44 +13:00
parent 4c98d1203b
commit f9d5bb737b
1 changed files with 10 additions and 9 deletions

View File

@ -60,11 +60,6 @@ and thus usually never needs to be set.
The
.BR sethostid ()
call is restricted to the superuser.
The
.I hostid
argument is stored in the file
.IR /etc/hostid .
.SH "RETURN VALUE"
.BR gethostid ()
returns the 32-bit identifier for the current host as set by
@ -86,8 +81,6 @@ to store the host ID.
.B EPERM
The calling process's effective user or group ID is not the same
as its corresponding real ID.
.SH FILES
.I /etc/hostid
.SH "CONFORMING TO"
4.2BSD; these functions were dropped in 4.4BSD.
SVr4 includes
@ -99,10 +92,18 @@ POSIX.1-2001 specifies
but not
.BR sethostid ().
.SH NOTES
In the glibc implementation, the
.I hostid
is stored in the file
.IR /etc/hostid .
(In glibc versions before 2.2, the file
.I /var/adm/hostid
was used.)
.\" libc5 used /etc/hostid; libc4 didn't have these functions
In the glibc implementation, if
.BR gethostid ()
cannot open
.IR /etc/hostid ,
cannot open the file containing the host ID,
then it obtains the hostname using
.BR gethostname (2),
passes that hostname to