[ Bottom of Page | Previous Page | Next Page | Contents | Index | Library Home | Legal | Search ]

Technical Reference: Communications, Volume 2

gethostid Subroutine

Purpose

Gets the unique identifier of the current host.

Library

Standard C Library (libc.a)

Syntax

#include <unistd.h>
 
int gethostid ( )

Description

The gethostid subroutine allows a process to retrieve the 32-bit identifier for the current host. In most cases, the host ID is stored in network standard byte order and is a DARPA Internet address for a local machine.

All applications containing the gethostid subroutine must be compiled with _BSD set to a specific value. Acceptable values are 43 and 44. In addition, all socket applications must include the BSD libbsd.a library.

Return Values

Upon successful completion, the gethostid subroutine returns the identifier for the current host.

If the gethostid subroutine is unsuccessful, the system handler performs the following functions:

Related Information

The gethostname subroutine, sethostid subroutine, sethostname subroutine.

Sockets Overview in AIX 5L Version 5.2 Communications Programming Concepts.

[ Top of Page | Previous Page | Next Page | Contents | Index | Library Home | Legal | Search ]