gethostid Subroutine

Purpose

Gets the unique identifier of the current host.

Library

Standard C Library (libc.a)

Syntax

#include <unistd.h>
 
int gethostid ( )

Description

The gethostid subroutine allows a process to retrieve the 32-bit identifier for the current host. In most cases, the host ID is stored in network standard byte order and is a DARPA Internet address for a local machine.

All applications containing the gethostid subroutine must be compiled with the _BSD macro set to a specific value. Acceptable values are 43 and 44. In addition, all socket applications must include the BSD libbsd.a library.

Return Values

Upon successful completion, the gethostid subroutine returns the identifier for the current host.