gethostid(3p)

gethostid3p

Get an identifier for the current host

Usage

#include <unistd.h>

long gethostid(void);

Prolog

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.

Overview

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.

Errors

No errors are defined.

The following sections are informative.

Examples

None.

Application usage

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

Rationale

None.

Future directions

None.

From man-pages 6.19-1 in Arch Linux 2026-11-01. Parsed by carta from the page's man source.