xref: /original-bsd/lib/libc/compat-43/gethostid.3 (revision b5bcb3e5)
1.\" Copyright (c) 1983, 1991 The Regents of the University of California.
2.\" All rights reserved.
3.\"
4.\" %sccs.include.redist.man%
5.\"
6.\"     @(#)gethostid.3	6.7 (Berkeley) 04/04/93
7.\"
8.Dd
9.Dt GETHOSTID 3
10.Os BSD 4.2
11.Sh NAME
12.Nm gethostid ,
13.Nm sethostid
14.Nd get/set unique identifier of current host
15.Sh SYNOPSIS
16.Fd #include <unistd.h>
17.Ft long
18.Fn gethostid void
19.Ft int
20.Fn sethostid "long hostid"
21.Sh DESCRIPTION
22.Fn Sethostid
23establishes a 32-bit identifier for the
24current processor that is intended to be unique among all
25UNIX systems in existence.  This is normally a DARPA Internet
26address for the local machine.  This call is allowed only to the
27super-user and is normally performed at boot time.
28.Pp
29.Fn Gethostid
30returns the 32-bit identifier for the current processor.
31.Pp
32This function has been deprecated.
33The hostid should be set or retrieved by use of
34.Xr sysctl 2 .
35.Sh SEE ALSO
36.Xr sysctl 2 ,
37.Xr gethostname 3 ,
38.Xr sysctl 8 .
39.Sh BUGS
4032 bits for the identifier is too small.
41.Sh HISTORY
42The
43.Fn gethostid
44and
45.Fn sethostid
46syscalls appeared in
47.Bx 4.2
48and were dropped in
49.Bx 4.4 .
50