sethostid

Name

sethostid -- set the unique identifier of the current host

Synopsis

#include <unistd.h>

int sethostid(long int hostid);

Description

sethostid sets a unique 32-bit identifier for the current machine. The 32-bit identifier is intended to be unique among all UNIX systems in existence. This normally resembles the Internet address for the local machine as returned by gethostbyname(3), and thus usually never needs to be set.

The sethostid call is restricted to the superuser.

hostid is stored in the file /etc/hostid.

Return Value

gethostid returns the 32-bit identifier for the current host as set by sethostid(2).

Files

/etc/hostid