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