Open System Services Library Calls Reference Manual (G06.27+, H06.04+)
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
H-series OSS processes: /G/system/zdllnnn/zinetdll
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 speci
fication.
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-004 Hewlett-Packard Company 5−13