summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorniklas <>1996-11-25 13:11:12 +0000
committerniklas <>1996-11-25 13:11:12 +0000
commitf65cadf74189693349862fc2f3bbbc571fa90cdb (patch)
tree4cc1d7f407b465d5eb1017429b8e15ad4f7301b7
parente90ea8c1c340d369223ab48a99985c6b649e51c0 (diff)
downloadopenbsd-f65cadf74189693349862fc2f3bbbc571fa90cdb.tar.gz
openbsd-f65cadf74189693349862fc2f3bbbc571fa90cdb.tar.bz2
openbsd-f65cadf74189693349862fc2f3bbbc571fa90cdb.zip
htons et al. works on explicit 16- and 32-bit quantities and not the
machine dependent "short" and "long" integer. Correct and enhance manpage. Change all short and longs to u_int16_t and u_int32_t, respectively. OpenBSD RCSIds
-rw-r--r--src/lib/libc/net/byteorder.326
1 files changed, 15 insertions, 11 deletions
diff --git a/src/lib/libc/net/byteorder.3 b/src/lib/libc/net/byteorder.3
index 723690cb16..b880869b05 100644
--- a/src/lib/libc/net/byteorder.3
+++ b/src/lib/libc/net/byteorder.3
@@ -1,4 +1,4 @@
1.\" $OpenBSD: byteorder.3,v 1.2 1996/08/19 08:28:34 tholo Exp $ 1.\" $OpenBSD: byteorder.3,v 1.3 1996/11/25 13:11:12 niklas Exp $
2.\" 2.\"
3.\" Copyright (c) 1983, 1991, 1993 3.\" Copyright (c) 1983, 1991, 1993
4.\" The Regents of the University of California. All rights reserved. 4.\" The Regents of the University of California. All rights reserved.
@@ -41,18 +41,22 @@
41.Nm ntohs 41.Nm ntohs
42.Nd convert values between host and network byte order 42.Nd convert values between host and network byte order
43.Sh SYNOPSIS 43.Sh SYNOPSIS
44.Fd #include <sys/param.h> 44.Fd #include <sys/types.h>
45.Ft u_long 45.Fd #include <machine/endian.h>
46.Fn htonl "u_long hostlong" 46.Ft u_int32_t
47.Ft u_short 47.Fn htonl "u_int32_t host32"
48.Fn htons "u_short hostshort" 48.Ft u_int16_t
49.Ft u_long 49.Fn htons "u_int16_t host16"
50.Fn ntohl "u_long netlong" 50.Ft u_int32_t
51.Ft u_short 51.Fn ntohl "u_int32_t net32"
52.Fn ntohs "u_short netshort" 52.Ft u_int16_t
53.Fn ntohs "u_int16_t net16"
53.Sh DESCRIPTION 54.Sh DESCRIPTION
54These routines convert 16 and 32 bit quantities between network 55These routines convert 16 and 32 bit quantities between network
55byte order and host byte order. 56byte order and host byte order. The last letter (s/l) is a mnemonic
57for the traditional names for such quantities, short and long,
58respectively. Today, the C concept of "short"/"long" integers
59need not coincide with this traditional misunderstanding.
56On machines which have a byte order which is the same as the network 60On machines which have a byte order which is the same as the network
57order, routines are defined as null macros. 61order, routines are defined as null macros.
58.Pp 62.Pp