From f65cadf74189693349862fc2f3bbbc571fa90cdb Mon Sep 17 00:00:00 2001 From: niklas <> Date: Mon, 25 Nov 1996 13:11:12 +0000 Subject: 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 --- src/lib/libc/net/byteorder.3 | 26 +++++++++++++++----------- 1 file 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 @@ -.\" $OpenBSD: byteorder.3,v 1.2 1996/08/19 08:28:34 tholo Exp $ +.\" $OpenBSD: byteorder.3,v 1.3 1996/11/25 13:11:12 niklas Exp $ .\" .\" Copyright (c) 1983, 1991, 1993 .\" The Regents of the University of California. All rights reserved. @@ -41,18 +41,22 @@ .Nm ntohs .Nd convert values between host and network byte order .Sh SYNOPSIS -.Fd #include -.Ft u_long -.Fn htonl "u_long hostlong" -.Ft u_short -.Fn htons "u_short hostshort" -.Ft u_long -.Fn ntohl "u_long netlong" -.Ft u_short -.Fn ntohs "u_short netshort" +.Fd #include +.Fd #include +.Ft u_int32_t +.Fn htonl "u_int32_t host32" +.Ft u_int16_t +.Fn htons "u_int16_t host16" +.Ft u_int32_t +.Fn ntohl "u_int32_t net32" +.Ft u_int16_t +.Fn ntohs "u_int16_t net16" .Sh DESCRIPTION These routines convert 16 and 32 bit quantities between network -byte order and host byte order. +byte order and host byte order. The last letter (s/l) is a mnemonic +for the traditional names for such quantities, short and long, +respectively. Today, the C concept of "short"/"long" integers +need not coincide with this traditional misunderstanding. On machines which have a byte order which is the same as the network order, routines are defined as null macros. .Pp -- cgit v1.2.3-55-g6feb