sethostid

Name

sethostid -- set the unique identifier of the current host (DEPRECATED)

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.

The sethostid() function is deprecated from the LSB and is expected to disappear from a future version of the LSB.

Return Value

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

Files

/etc/hostid