NAME | SYNOPSIS | DESCRIPTION | USAGE | RETURN VALUES | ERRORS | ATTRIBUTES | SEE ALSO
cc [ flag ... ] file ... -lxnet [ library ... ] #include <arpa/inet.h>uint32_t htonl(uint32_t hostlong);
These functions convert 16-bit and 32-bit quantities between network byte order and host byte order.
The uint32_t and uint16_t types are made available by inclusion of <inttypes.h>.
These functions are most often used in conjunction with Internet addresses and ports as returned by gethostent(3XNET) and getservent(3XNET).
On some architectures these functions are defined as macros that expand to the value of their argument.
The htonl() and htons() functions return the argument value converted from host to network byte order.
The ntohl() and ntohs() functions return the argument value converted from network to host byte order.
No errors are defined.
See attributes(5) for descriptions of the following attributes:
ATTRIBUTE TYPE | ATTRIBUTE VALUE |
MT-Level | MT-Safe |
NAME | SYNOPSIS | DESCRIPTION | USAGE | RETURN VALUES | ERRORS | ATTRIBUTES | SEE ALSO