summaryrefslogtreecommitdiff
path: root/usr/src/man/man3c
diff options
context:
space:
mode:
authorYuri Pankov <yuri.pankov@nexenta.com>2018-08-03 21:34:10 +0300
committerRichard Lowe <richlowe@richlowe.net>2018-08-06 19:38:36 +0000
commitcc581a18c90036f3cc09e518f22af9b2f11b2a8d (patch)
tree45cb4d3dbb1afc1f1f182daef02bffebd624ea13 /usr/src/man/man3c
parent8cd3131235b232e4d63be3cf95ce9be87907e74f (diff)
downloadillumos-joyent-cc581a18c90036f3cc09e518f22af9b2f11b2a8d.tar.gz
9701 byteorder functions are in libc for a long time
Reviewed by: Toomas Soome <tsoome@me.com> Reviewed by: Peter Tribble <peter.tribble@gmail.com> Reviewed by: Igor Kozhukhov <igor@dilos.org> Approved by: Richard Lowe <richlowe@richlowe.net>
Diffstat (limited to 'usr/src/man/man3c')
-rw-r--r--usr/src/man/man3c/Makefile14
-rw-r--r--usr/src/man/man3c/byteorder.3c86
-rw-r--r--usr/src/man/man3c/endian.3c6
3 files changed, 103 insertions, 3 deletions
diff --git a/usr/src/man/man3c/Makefile b/usr/src/man/man3c/Makefile
index dcdaad1271..2864756ce9 100644
--- a/usr/src/man/man3c/Makefile
+++ b/usr/src/man/man3c/Makefile
@@ -59,6 +59,7 @@ MANFILES= __fbufsize.3c \
bsearch.3c \
bstring.3c \
btowc.3c \
+ byteorder.3c \
call_once.3c \
catgets.3c \
catopen.3c \
@@ -885,6 +886,9 @@ MANLINKS= FD_CLR.3c \
htole16.3c \
htole32.3c \
htole64.3c \
+ htonl.3c \
+ htonll.3c \
+ htons.3c \
inet6.3c \
inet_addr.3c \
inet_aton.3c \
@@ -1032,6 +1036,9 @@ MANLINKS= FD_CLR.3c \
ngettext.3c \
nl_langinfo_l.3c \
nrand48.3c \
+ ntohl.3c \
+ ntohll.3c \
+ ntohs.3c \
openlog.3c \
pclose.3c \
port_dissociate.3c \
@@ -1563,6 +1570,13 @@ explicit_bzero.3c := LINKSRC = bstring.3c
btowc_l.3c := LINKSRC = btowc.3c
+htonl.3c := LINKSRC = byteorder.3c
+htonll.3c := LINKSRC = byteorder.3c
+htons.3c := LINKSRC = byteorder.3c
+ntohl.3c := LINKSRC = byteorder.3c
+ntohll.3c := LINKSRC = byteorder.3c
+ntohs.3c := LINKSRC = byteorder.3c
+
canonicalize_file_name.3c := LINKSRC = realpath.3c
catclose.3c := LINKSRC = catopen.3c
diff --git a/usr/src/man/man3c/byteorder.3c b/usr/src/man/man3c/byteorder.3c
new file mode 100644
index 0000000000..16de6b983e
--- /dev/null
+++ b/usr/src/man/man3c/byteorder.3c
@@ -0,0 +1,86 @@
+.\"
+.\" The contents of this file are subject to the terms of the
+.\" Common Development and Distribution License (the "License").
+.\" You may not use this file except in compliance with the License.
+.\"
+.\" You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+.\" or http://www.opensolaris.org/os/licensing.
+.\" See the License for the specific language governing permissions
+.\" and limitations under the License.
+.\"
+.\" When distributing Covered Code, include this CDDL HEADER in each
+.\" file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+.\" If applicable, add the following below this CDDL HEADER, with the
+.\" fields enclosed by brackets "[]" replaced with your own identifying
+.\" information: Portions Copyright [yyyy] [name of copyright owner]
+.\"
+.\"
+.\" Copyright 1989 AT&T
+.\" Copyright (c) 2008, Sun Microsystems, Inc. All Rights Reserved
+.\" Copyright 2018 Nexenta Systems, Inc.
+.\"
+.Dd August 2, 2018
+.Dt BYTEORDER 3C
+.Os
+.Sh NAME
+.Nm byteorder ,
+.Nm htonl ,
+.Nm htonll ,
+.Nm htons ,
+.Nm ntohl ,
+.Nm ntohll ,
+.Nm ntohs
+.Nd convert values between host and network byte order
+.Sh LIBRARY
+.Lb libc
+.Sh SYNOPSIS
+.In sys/types.h
+.In netinet/in.h
+.In inttypes.h
+.Ft uint32_t
+.Fo htonl
+.Fa "uint32_t hostlong"
+.Fc
+.Ft uint64_t
+.Fo htonll
+.Fa "uint64_t hostlonglong"
+.Fc
+.Ft uint16_t
+.Fo htons
+.Fa "uint16_t hostshort"
+.Fc
+.Ft uint32_t
+.Fo ntohl
+.Fa "uint32_t netlong"
+.Fc
+.Ft uint64_t
+.Fo ntohll
+.Fa "uint64_t netlonglong"
+.Fc
+.Ft uint16_t
+.Fo ntohs
+.Fa "uint16_t netshort"
+.Fc
+.Sh DESCRIPTION
+These functions convert 16-bit, 32-bit, and 64-bit quantities between network
+byte order and host byte order.
+On some architectures these routines are defined as
+.Dv NULL
+macros in the include file
+.In netinet/in.h .
+On other architectures, the routines are functional when the host byte order is
+different from network byte order.
+.Pp
+These functions are most often used in conjunction with Internet addresses and
+ports as returned by
+.Xr gethostent 3NSL
+and
+.Xr getservent 3NSL .
+.Sh MT-LEVEL
+.Sy Safe
+.Sh SEE ALSO
+.Xr inet.h 3HEAD ,
+.Xr gethostent 3NSL ,
+.Xr getservent 3NSL ,
+.Xr attributes 5 ,
+.Xr byteorder 5
diff --git a/usr/src/man/man3c/endian.3c b/usr/src/man/man3c/endian.3c
index 658d47ba58..65c07323bb 100644
--- a/usr/src/man/man3c/endian.3c
+++ b/usr/src/man/man3c/endian.3c
@@ -11,7 +11,7 @@
.\"
.\" Copyright 2016 Joyent, Inc.
.\"
-.Dd January 30, 2016
+.Dd August 2, 2018
.Dt ENDIAN 3C
.Os
.Sh NAME
@@ -177,7 +177,7 @@ To better support extant software, both are provided.
While these functions are common across multiple platforms, they have
not been standardized.
Portable applications should instead use the functions defined in
-.Xr byteorder 3SOCKET .
+.Xr byteorder 3C .
.Sh RETURN VALUES
The functions always succeed and return a value that has been properly
converted.
@@ -186,7 +186,7 @@ converted.
.Sh MT-LEVEL
.Sy MT-Safe
.Sh SEE ALSO
+.Xr byteorder 3C ,
.Xr endian.h 3HEAD ,
-.Xr byteorder 3SOCKET ,
.Xr attributes 5 ,
.Xr byteorder 5