convert a 32-bit value from host byte order to network byte order
#include <netinet/in.h> unsigned long htonl( unsigned long hostlong );
This function converts a 32-bit value from host byte order to network byte order.
This routine is most often used in conjunction with Internet addresses and ports returned by gethostbyname() and getservent().
The value in network byte order.
POSIX 1003.1g (draft)
Safety: | |
---|---|
Interrupt handler | Yes |
Signal handler | Yes |
Thread | Yes |