Open System Services Library Calls Reference Manual (G06.29+, H06.08+, J06.03+)
OSS Library Calls (n - r) ntohs(3)
NAME
ntohs - Converts a 16-bit integer from Internet network byte order to host 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 ntohs(
in_port_t netshort);
PARAMETERS
netshort Specifies a 16-bit integer in network byte order.
DESCRIPTION
The ntohs( ) (network-to-host short) function converts a 16-bit integer from Internet network byte
order to host byte order. This function is provided for compatibility with the XPG4 specification.
The ntohs( ) function is most often used to convert the values returned by the gethostent( ) and
getservent( ) functions.
RETURN VALUES
The ntohs( ) function returns a 16-bit integer in host byte order.
ERRORS
The ntohs( ) function does not set errno.
RELATED INFORMATION
Functions: ntohl(3), htonl(3), htons(3).
527187-017 Hewlett-Packard Company 5−35