Index of Section 3 Manual Pages
| Interix / SUA | ntohs.3 | Interix / SUA |
ntohs(3) ntohs(3)
htonl()
NAME
htonl(), htons(), ntohl(), ntohs() - convert values between host and
network byte order
SYNOPSIS
#include
in_addr_t htonl (unsigned long hostlong)
in_port_t htons (unsigned short hostshort)
in_addr_t ntohl (unsigned long netlong)
in_port_t ntohs (unsigned short netshort)
DESCRIPTION
These routines convert 16 and 32 bit quantities between network byte order
and host byte order.
These routines are most often used in conjunction with Internet addresses
and ports as returned by gethostbyname(2).
NOTES
The htons(3) and ntohs(3) functions must have the correct prototype. If
not declared, they are assumed to return an int, and there is no guarantee
that the high word will be zeroed.
SEE ALSO
gethostbyname(2)
USAGE NOTES
All of these functions are thread safe.
None of these functions are async-signal safe.