gethostid()

The gethostid() call returns the unique 32-bit identifier of the current host.

Syntax

#include <unistd.h>
u_long gethostid()

Return Values

The gethostid() call returns the 32-bit identifier, in host-byte order of the current host, which should be unique across all hosts. This identifier is usually the IP address of the primary interface. The default primary interface is lan0. For a slip only or PPP only configuration, the sl0 or ppp0 is the primary interface. If no primary interface exists, the call returns a hexadecimal of X'FFFFFFFF'.

Related Calls


[Back: gethostent()]
[Next: gethostname()]