diff options
-rw-r--r-- | src/lib/libc/net/byteorder.3 | 26 |
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 |
54 | These routines convert 16 and 32 bit quantities between network | 55 | These routines convert 16 and 32 bit quantities between network |
55 | byte order and host byte order. | 56 | byte order and host byte order. The last letter (s/l) is a mnemonic |
57 | for the traditional names for such quantities, short and long, | ||
58 | respectively. Today, the C concept of "short"/"long" integers | ||
59 | need not coincide with this traditional misunderstanding. | ||
56 | On machines which have a byte order which is the same as the network | 60 | On machines which have a byte order which is the same as the network |
57 | order, routines are defined as null macros. | 61 | order, routines are defined as null macros. |
58 | .Pp | 62 | .Pp |