summaryrefslogtreecommitdiff
path: root/usr/src/man/man3c
diff options
context:
space:
mode:
authorRobert Mustacchi <rm@joyent.com>2016-04-11 08:32:33 -0700
committerRobert Mustacchi <rm@joyent.com>2016-05-19 07:45:53 -0700
commit7dc9a163b382daee1ce43b6588dd1b507363dae5 (patch)
tree198b5409d85494cff2c3bce7054ae6b1cac985e0 /usr/src/man/man3c
parente56998eefc33ead0f12b364be915dd6bfc12a3f5 (diff)
downloadillumos-joyent-7dc9a163b382daee1ce43b6588dd1b507363dae5.tar.gz
6790 want suite of endian(3C) functions
Reviewed by: Dan McDonald <danmcd@omniti.com> Reviewed by: Richard Lowe <richlowe@richlowe.net> Approved by: Garrett D'Amore <garrett@damore.org>
Diffstat (limited to 'usr/src/man/man3c')
-rw-r--r--usr/src/man/man3c/Makefile38
-rw-r--r--usr/src/man/man3c/endian.3c191
2 files changed, 229 insertions, 0 deletions
diff --git a/usr/src/man/man3c/Makefile b/usr/src/man/man3c/Makefile
index eebbda3288..61591de7e7 100644
--- a/usr/src/man/man3c/Makefile
+++ b/usr/src/man/man3c/Makefile
@@ -113,6 +113,7 @@ MANFILES= __fbufsize.3c \
enable_extended_FILE_stdio.3c \
encrypt.3c \
end.3c \
+ endian.3c \
epoll_create.3c \
epoll_ctl.3c \
epoll_wait.3c \
@@ -698,6 +699,12 @@ MANLINKS= FD_CLR.3c \
backtrace_symbols_fd.3c \
bcmp.3c \
bcopy.3c \
+ be16toh.3c \
+ be32toh.3c \
+ be64toh.3c \
+ betoh16.3c \
+ betoh32.3c \
+ betoh64.3c \
bind_textdomain_codeset.3c \
bindtextdomain.3c \
btowc_l.3c \
@@ -861,6 +868,12 @@ MANLINKS= FD_CLR.3c \
hasmntopt.3c \
hcreate.3c \
hdestroy.3c \
+ htobe16.3c \
+ htobe32.3c \
+ htobe64.3c \
+ htole16.3c \
+ htole32.3c \
+ htole64.3c \
initstate.3c \
innetgr.3c \
isalnum.3c \
@@ -934,6 +947,12 @@ MANLINKS= FD_CLR.3c \
labs.3c \
lcong48.3c \
ldiv.3c \
+ le16toh.3c \
+ le32toh.3c \
+ le64toh.3c \
+ letoh16.3c \
+ letoh32.3c \
+ letoh64.3c \
lfind.3c \
llabs.3c \
lldiv.3c \
@@ -1635,6 +1654,25 @@ _etext.3c := LINKSRC = end.3c
edata.3c := LINKSRC = end.3c
etext.3c := LINKSRC = end.3c
+be16toh.3c := LINKSRC = endian.3c
+be32toh.3c := LINKSRC = endian.3c
+be64toh.3c := LINKSRC = endian.3c
+betoh16.3c := LINKSRC = endian.3c
+betoh32.3c := LINKSRC = endian.3c
+betoh64.3c := LINKSRC = endian.3c
+htobe16.3c := LINKSRC = endian.3c
+htobe32.3c := LINKSRC = endian.3c
+htobe64.3c := LINKSRC = endian.3c
+htole16.3c := LINKSRC = endian.3c
+htole32.3c := LINKSRC = endian.3c
+htole64.3c := LINKSRC = endian.3c
+le16toh.3c := LINKSRC = endian.3c
+le32toh.3c := LINKSRC = endian.3c
+le64toh.3c := LINKSRC = endian.3c
+letoh16.3c := LINKSRC = endian.3c
+letoh32.3c := LINKSRC = endian.3c
+letoh64.3c := LINKSRC = endian.3c
+
epoll_create1.3c := LINKSRC = epoll_create.3c
epoll_pwait.3c := LINKSRC = epoll_wait.3c
diff --git a/usr/src/man/man3c/endian.3c b/usr/src/man/man3c/endian.3c
new file mode 100644
index 0000000000..5161af8fbd
--- /dev/null
+++ b/usr/src/man/man3c/endian.3c
@@ -0,0 +1,191 @@
+.\"
+.\" This file and its contents are supplied under the terms of the
+.\" Common Development and Distribution License ("CDDL"), version 1.0.
+.\" You may only use this file in accordance with the terms of version
+.\" 1.0 of the CDDL.
+.\"
+.\" A full copy of the text of the CDDL should have accompanied this
+.\" source. A copy of the CDDL is also available via the Internet at
+.\" http://www.illumos.org/license/CDDL.
+.\"
+.\"
+.\" Copyright 2016 Joyent, Inc.
+.\"
+.Dd January 30, 2016
+.Dt ENDIAN 3C
+.Os
+.Sh NAME
+.Nm endian ,
+.Nm be16toh ,
+.Nm be32toh ,
+.Nm be64toh ,
+.Nm betoh16 ,
+.Nm betoh32 ,
+.Nm betoh64 ,
+.Nm htobe16 ,
+.Nm htobe32 ,
+.Nm htobe64 ,
+.Nm htole16 ,
+.Nm htole32 ,
+.Nm htole64 ,
+.Nm le16toh ,
+.Nm le32toh ,
+.Nm le64toh ,
+.Nm letoh16 ,
+.Nm letoh32 ,
+.Nm letoh64
+.Nd convert between big and little endian byte order
+.Sh SYNOPSIS
+.In endian.h
+.Ft uint16_t
+.Fo be16toh
+.Fa "uint16_t be16"
+.Fc
+.Ft uint32_t
+.Fo be32toh
+.Fa "uint32_t be32"
+.Fc
+.Ft uint64_t
+.Fo betoh64
+.Fa "uint64_t be64"
+.Fc
+.Ft uint16_t
+.Fo betoh16
+.Fa "uint16_t be16"
+.Fc
+.Ft uint32_t
+.Fo betoh32
+.Fa "uint32_t be32"
+.Fc
+.Ft uint64_t
+.Fo be64toh
+.Fa "uint64_t be64"
+.Fc
+.Ft uint16_t
+.Fo htobe16
+.Fa "uint16_t host16"
+.Fc
+.Ft uint32_t
+.Fo htobe32
+.Fa "uint32_t host32"
+.Fc
+.Ft uint64_t
+.Fo htobe64
+.Fa "uint64_t host64"
+.Fc
+.Ft uint16_t
+.Fo htole16
+.Fa "uint16_t host16"
+.Fc
+.Ft uint32_t
+.Fo htole32
+.Fa "uint32_t host32"
+.Fc
+.Ft uint64_t
+.Fo htole64
+.Fa "uint64_t host64"
+.Fc
+.Ft uint16_t
+.Fo le16toh
+.Fa "uint16_t le16"
+.Fc
+.Ft uint32_t
+.Fo le32toh
+.Fa "uint32_t le32"
+.Fc
+.Ft uint64_t
+.Fo le64toh
+.Fa "uint64_t le64"
+.Fc
+.Ft uint16_t
+.Fo letoh16
+.Fa "uint16_t le16"
+.Fc
+.Ft uint32_t
+.Fo letoh32
+.Fa "uint32_t le32"
+.Fc
+.Ft uint64_t
+.Fo letoh64
+.Fa "uint64_t le64"
+.Fc
+.Sh DESCRIPTION
+The
+.Nm
+family of functions convert 16, 32, and 64-bit values between the host's
+native byte order and big- or little-endian. All of the functions in
+this family simply return their input when the host's native byte order
+is the same as the desired order. For more information on
+endianness, see
+.Xr byteorder 5 .
+.Pp
+The
+.Fn betoh16 ,
+.Fn betoh32 ,
+and
+.Fn betoh64
+functions take a 16-bit, 32-bit, or 64-bit value and convert it from
+big-endian to the host's native endianness, swapping bytes as required.
+.Pp
+The
+.Fn letoh16 ,
+.Fn letoh32 ,
+and
+.Fn letoh64
+functions take a 16-bit, 32-bit, or 64-bit value and convert it from
+little-endian to the host's native endianness, swapping bytes as
+required.
+.Pp
+The
+.Fn htobe16 ,
+.Fn htobe32 ,
+and
+.Fn htobe64
+functions take a 16-bit, 32-bit, or 64-bit value and convert it from
+the host's native endianness to big-endian, swapping bytes as required.
+.Pp
+The
+.Fn htole16 ,
+.Fn htole32 ,
+and
+.Fn htole64
+functions take a 16-bit, 32-bit, or 64-bit value and convert it from
+the host's native endianness to little-endian, swapping bytes as
+required.
+.Pp
+The functions
+.Fn be16toh ,
+.Fn be32toh ,
+.Fn be64toh ,
+.Fn le16toh ,
+.Fn le32toh ,
+and
+.Fn le64toh ,
+are the same as
+.Fn betoh16 ,
+.Fn betoh32 ,
+.Fn betoh64 ,
+.Fn letoh16 ,
+.Fn letoh32 ,
+and
+.Fn letoh64
+respectively. Historically, different platforms have diverged on the
+naming of these functions. To better support extant software, both are
+provided.
+.Pp
+While these functions are common across multiple platforms, they have
+not been standardized. Portable applications should instead use the
+functions defined in
+.Xr byteorder 3C .
+.Sh RETURN VALUES
+The functions always succeed and return a value that has been properly
+converted.
+.Sh INTERFACE STABILITY
+.Sy Committed
+.Sh MT-LEVEL
+.Sy MT-Safe
+.Sh SEE ALSO
+.Xr byteorder 3C ,
+.Xr endian.h 3HEAD ,
+.Xr attributes 5 ,
+.Xr byteorder 5