.\" Copyright 1993 David Metcalfe (david@prism.demon.co.uk)
.\"
+.\" %%%LICENSE_START(VERBATIM)
.\" Permission is granted to make and distribute verbatim copies of this
.\" manual provided the copyright notice and this permission notice are
.\" preserved on all copies.
.\"
.\" Formatted or processed versions of this manual, if unaccompanied by
.\" the source, must acknowledge the copyright and authors of this work.
+.\" %%%LICENSE_END
.\"
.\" References consulted:
.\" Linux libc source code
.\" Modified Sat Jul 24 21:29:05 1993 by Rik Faith (faith@cs.unc.edu)
.\" Modified Thu Jul 26 14:06:20 2001 by Andries Brouwer (aeb@cwi.nl)
.\"
-.TH BYTEORDER 3 2009-01-15 "GNU" "Linux Programmer's Manual"
+.TH BYTEORDER 3 2014-04-08 "GNU" "Linux Programmer's Manual"
.SH NAME
htonl, htons, ntohl, ntohs \- convert values between host and network
byte order
.SH DESCRIPTION
The
.BR htonl ()
-function converts the unsigned integer \fIhostlong\fP
+function converts the unsigned integer
+.I hostlong
from host byte order to network byte order.
.PP
The
.BR htons ()
-function converts the unsigned short integer \fIhostshort\fP
+function converts the unsigned short integer
+.I hostshort
from host byte order to network byte order.
.PP
The
.BR ntohl ()
-function converts the unsigned integer \fInetlong\fP
+function converts the unsigned integer
+.I netlong
from network byte order to host byte order.
.PP
The
.BR ntohs ()
-function converts the unsigned short integer \fInetshort\fP
+function converts the unsigned short integer
+.I netshort
from network byte order to host byte order.
.PP
On the i386 the host byte order is Least Significant Byte first,
whereas the network byte order, as used on the Internet, is Most
Significant Byte first.
-.SH "CONFORMING TO"
+.SH ATTRIBUTES
+.SS Multithreading (see pthreads(7))
+The
+.BR htonl (),
+.BR htons (),
+.BR ntohl (),
+and
+.BR ntohs ()
+functions are thread-safe.
+.SH CONFORMING TO
POSIX.1-2001.
Some systems require the inclusion of
.I <netinet/in.h>
instead of
.IR <arpa/inet.h> .
-.SH "SEE ALSO"
+.SH SEE ALSO
.BR endian (3),
.BR gethostbyname (3),
.BR getservent (3)
+.SH COLOPHON
+This page is part of release 3.79 of the Linux
+.I man-pages
+project.
+A description of the project,
+information about reporting bugs,
+and the latest version of this page,
+can be found at
+\%http://www.kernel.org/doc/man\-pages/.