Create a manual to document the new kernel byte order conversion
functions. Reviewed by: tmm
This commit is contained in:
parent
2cfaf1e315
commit
8a1791edf4
@ -25,6 +25,7 @@ MAN= BUF_LOCK.9 BUF_LOCKFREE.9 BUF_LOCKINIT.9 BUF_REFCNT.9 \
|
||||
bus_generic_detach.9 \
|
||||
bus_generic_print_child.9 bus_generic_read_ivar.9 \
|
||||
bus_generic_shutdown.9 bus_release_resource.9 \
|
||||
byteorder.9 \
|
||||
cd.9 cdevsw_add.9 cdevsw_remove.9 condvar.9 copy.9 \
|
||||
critical_enter.9 \
|
||||
devclass.9 devclass_add_driver.9 devclass_find.9 \
|
||||
@ -107,6 +108,18 @@ MLINKS+=atomic.9 atomic_subtract.9
|
||||
MLINKS+=atomic.9 atomic_store.9
|
||||
MLINKS+=at_exit.9 rm_at_exit.9
|
||||
MLINKS+=at_fork.9 rm_at_fork.9
|
||||
MLINKS+=byteorder.9 be16toh.9
|
||||
MLINKS+=byteorder.9 be32toh.9
|
||||
MLINKS+=byteorder.9 be64toh.9
|
||||
MLINKS+=byteorder.9 htobe16.9
|
||||
MLINKS+=byteorder.9 htobe32.9
|
||||
MLINKS+=byteorder.9 htobe64.9
|
||||
MLINKS+=byteorder.9 htole16.9
|
||||
MLINKS+=byteorder.9 htole32.9
|
||||
MLINKS+=byteorder.9 htole64.9
|
||||
MLINKS+=byteorder.9 le16toh.9
|
||||
MLINKS+=byteorder.9 le32toh.9
|
||||
MLINKS+=byteorder.9 le64toh.9
|
||||
MLINKS+=condvar.9 cv_init.9
|
||||
MLINKS+=condvar.9 cv_destroy.9
|
||||
MLINKS+=condvar.9 cv_wait.9
|
||||
|
113
share/man/man9/byteorder.9
Normal file
113
share/man/man9/byteorder.9
Normal file
@ -0,0 +1,113 @@
|
||||
.\" Copyright (c) 2002 Mike Barcroft <mike@FreeBSD.org>
|
||||
.\" All rights reserved.
|
||||
.\"
|
||||
.\" Redistribution and use in source and binary forms, with or without
|
||||
.\" modification, are permitted provided that the following conditions
|
||||
.\" are met:
|
||||
.\" 1. Redistributions of source code must retain the above copyright
|
||||
.\" notice, this list of conditions and the following disclaimer.
|
||||
.\" 2. Redistributions in binary form must reproduce the above copyright
|
||||
.\" notice, this list of conditions and the following disclaimer in the
|
||||
.\" documentation and/or other materials provided with the distribution.
|
||||
.\"
|
||||
.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
|
||||
.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
|
||||
.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
||||
.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
.\" SUCH DAMAGE.
|
||||
.\"
|
||||
.\" $FreeBSD$
|
||||
.\"
|
||||
.Dd March 5, 2002
|
||||
.Dt BYTEORDER 9
|
||||
.Os
|
||||
.Sh NAME
|
||||
.Nm be16toh ,
|
||||
.Nm be32toh ,
|
||||
.Nm be64toh ,
|
||||
.Nm htobe16 ,
|
||||
.Nm htobe32 ,
|
||||
.Nm htobe64 ,
|
||||
.Nm htole16 ,
|
||||
.Nm htole32 ,
|
||||
.Nm htole64 ,
|
||||
.Nm le16toh ,
|
||||
.Nm le32toh ,
|
||||
.Nm le64toh
|
||||
.Nd convert values between big endian, little endian, and host byte order
|
||||
.Sh SYNOPSIS
|
||||
.In sys/param.h
|
||||
.Ft uint16_t
|
||||
.Fn be16toh "uint16_t big16"
|
||||
.Ft uint32_t
|
||||
.Fn be32toh "uint32_t big32"
|
||||
.Ft uint64_t
|
||||
.Fn be64toh "uint64_t big64"
|
||||
.Ft uint16_t
|
||||
.Fn htobe16 "uint16_t host16"
|
||||
.Ft uint32_t
|
||||
.Fn htobe32 "uint32_t host32"
|
||||
.Ft uint64_t
|
||||
.Fn htobe64 "uint64_t host64"
|
||||
.Ft uint16_t
|
||||
.Fn htole16 "uint16_t host16"
|
||||
.Ft uint32_t
|
||||
.Fn htole32 "uint32_t host32"
|
||||
.Ft uint64_t
|
||||
.Fn htole64 "uint64_t host64"
|
||||
.Ft uint16_t
|
||||
.Fn le16toh "uint16_t little16"
|
||||
.Ft uint32_t
|
||||
.Fn le32toh "uint32_t little32"
|
||||
.Ft uint64_t
|
||||
.Fn le64toh "uint64_t little64"
|
||||
.Sh DESCRIPTION
|
||||
The
|
||||
.Fn be16toh ,
|
||||
.Fn be32toh ,
|
||||
and
|
||||
.Fn be64toh
|
||||
functions return a big endian byte ordered integer
|
||||
converted to the system's native byte order.
|
||||
The return value will be the same as the argument on big endian systems.
|
||||
.Pp
|
||||
The
|
||||
.Fn le16toh ,
|
||||
.Fn le32toh ,
|
||||
and
|
||||
.Fn le64toh
|
||||
functions return a little endian byte ordered integer
|
||||
converted to the system's native byte order.
|
||||
The return value will be the same as the argument on little endian systems.
|
||||
.Pp
|
||||
The
|
||||
.Fn htobe16 ,
|
||||
.Fn htobe32 ,
|
||||
and
|
||||
.Fn htobe64
|
||||
functions return a integer in the system's native
|
||||
byte order converted to big endian byte order.
|
||||
The return value will be the same as the argument on big endian systems.
|
||||
.Pp
|
||||
The
|
||||
.Fn htole16 ,
|
||||
.Fn htole32 ,
|
||||
and
|
||||
.Fn htole64
|
||||
functions return a integer in the system's native
|
||||
byte order converted to little endian byte order.
|
||||
The return value will be the same as the argument on little endian systems.
|
||||
.Sh SEE ALSO
|
||||
.Xr byteorder 3
|
||||
.Sh HISTORY
|
||||
These functions first appeared in
|
||||
.Fx 5.0 ,
|
||||
and were originally developed by the
|
||||
.Nx
|
||||
project.
|
Loading…
x
Reference in New Issue
Block a user