The gethostid() call returns the 32-bit identifier unique to the current host. This value is the default home internet address.
This call can be used only in the AF_INET domain.
#include <manifest.h>
#include <socket.h>
unsigned long gethostid()
The gethostid() call returns the 32-bit identifier of the current host, which should be unique across all hosts. When a NULL pointer or 0 is returned, the value of errno is indeterminate, and, therefore, the output from a tcperror() call is also not valid.
gethostname()