gethostid man page


This manual page is part of the POSIX Programmer's Manual. The Linux implementation of this interface may differ (consult the corresponding Linux manual page for details of Linux behavior), or the interface may not be implemented on Linux.

gethostid — get an identifier for the current host


#include <unistd.h>

long gethostid(void);


The gethostid() function shall retrieve a 32-bit identifier for the current host.

Return Value

Upon successful completion, gethostid() shall return an identifier for the current host.


No errors are defined.

The following sections are informative.

Application Usage

This volume of POSIX.1‐2008 does not define the domain in which the return value is unique.

See Also


The Base Definitions volume of POSIX.1‐2008, <unistd.h>


2013 IEEE/The Open Group POSIX Programmer's Manual