#include <unistd.h>
The gethostid() function returns the 32-bit identifier for the current host. This identifier is taken from the CPU board's ID PROM. It is not guaranteed to be unique.
See attributes(5) for descriptions of the following attributes:
hostid(1), sysinfo(2), attributes(5)