Your Browser is not longer supported

Please use Google Chrome, Mozilla Firefox or Microsoft Edge to view the page correctly
Loading...

{{viewport.spaceProperty.prod}}

gethostid - get ID of current host

&pagelevel(4)&pagelevel

Syntax

#include <unistd.h>

long gethostid(void);

Description gethostid() outputs a 32-bit ID for the current host. The ID is formed from the CPU serial

number (3 bytes) and the VM ID (1 byte), so that several VMs in a system can be
distinguished from each other.

Return val.

Unique ID for the current host

if successful.

See also

random(), unistd.h.