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

Technical Reference: Communications, Volume 2


sethostid Subroutine

Purpose

Sets the unique identifier of the current host.

Library

Standard C Library (libc.a)

Syntax


int sethostid ( HostID)
int HostID;

Description

The sethostid subroutine allows a calling process with a root user ID to set a new 32-bit identifier for the current host. The sethostid subroutine enables an application program to reset the host ID.

Parameters


HostID Specifies the unique 32-bit identifier for the current host.

Return Values

Upon successful completion, the sethostid subroutine returns a value of 0.

If the sethostid subroutine is unsuccessful, the subroutine handler performs the following functions:

Error Codes

The sethostid subroutine is unsuccessful if the following is true:

EPERM The calling process did not have an effective user ID of root user.

Implementation Specifics

The sethostid subroutine is part of Base Operating System (BOS) Runtime.

All applications containing the sethostid 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.

Related Information

The getsockname subroutine, gethostid subroutine, gethostname subroutine.

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


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