Open System Services Library Calls Reference Manual (G06.27+, H06.04+)
OSS Library Calls (g - h) htonl(3)
NAME
htonl - Converts a 32-bit integer from host byte order to Internet network byte order
LIBRARY
G-series native OSS processes: /G/system/sysnn/zinetsrl
H-series OSS processes: /G/system/zdllnnn/zinetdll
SYNOPSIS
#include <arpa/inet.h>
in_addr_t htonl(
in_addr_t hostlong);
PARAMETERS
hostlong Specifies a 32-bit integer in host byte order.
DESCRIPTION
The htonl() (host-to-network long) function converts a 32-bit integer from host byte order to
Internet network byte order. The htonl() function is provided for compatibility with the XPG4
specification.
The htonl() function is most often used to convert values returned by gethostent() and getser-
vent().
RETURN VALUES
The htonl() function returns a 32-bit long integer in Internet network byte order.
ERRORS
The htonl() function does not set errno.
RELATED INFORMATION
Functions: htons(3), ntohl(3), ntohs(3).
527187-004 Hewlett-Packard Company 3−101