From c10c16dec587a0662068f6e2991c29ed3a9db943 Mon Sep 17 00:00:00 2001 From: Richard Lowe Date: Mon, 14 Mar 2011 14:05:30 -0400 Subject: 243 system manual pages should live with the software Reviewed by: garrett@nexenta.com Reviewed by: gwr@nexenta.com Reviewed by: trisk@opensolaris.org Approved by: gwr@nexenta.com --HG-- extra : rebase_source : 0c599d0bec0dc8865fbba67721a7a6cd6b1feefb --- usr/src/man/man3socket/byteorder.3socket | 81 ++++++++++++++++++++++++++++++++ 1 file changed, 81 insertions(+) create mode 100644 usr/src/man/man3socket/byteorder.3socket (limited to 'usr/src/man/man3socket/byteorder.3socket') diff --git a/usr/src/man/man3socket/byteorder.3socket b/usr/src/man/man3socket/byteorder.3socket new file mode 100644 index 0000000000..63984a833f --- /dev/null +++ b/usr/src/man/man3socket/byteorder.3socket @@ -0,0 +1,81 @@ +'\" te +.\" Copyright (c) 2008, Sun Microsystems, Inc. All Rights Reserved +.\" Copyright 1989 AT&T +.\" The contents of this file are subject to the terms of the Common Development and Distribution License (the "License"). You may not use this file except in compliance with the License. +.\" You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE or http://www.opensolaris.org/os/licensing. See the License for the specific language governing permissions and limitations under the License. +.\" When distributing Covered Code, include this CDDL HEADER in each file and include the License file at usr/src/OPENSOLARIS.LICENSE. If applicable, add the following below this CDDL HEADER, with the fields enclosed by brackets "[]" replaced with your own identifying information: Portions Copyright [yyyy] [name of copyright owner] +.TH byteorder 3SOCKET "10 Sep 2008" "SunOS 5.11" "Sockets Library Functions" +.SH NAME +byteorder, htonl, htonll, htons, ntohl, ntohll, ntohs \- convert values between +host and network byte order +.SH SYNOPSIS +.LP +.nf +\fBcc\fR [ \fIflag\fR... ] \fIfile\fR... \fB-lsocket\fR \fB -lnsl \fR [ \fIlibrary\fR... ] +#include +#include +#include + +\fBuint32_t\fR \fBhtonl\fR(\fBuint32_t\fR \fIhostlong\fR); +.fi + +.LP +.nf +\fBuint64_t\fR \fBhtonll\fR(\fBuint64_t\fR \fIhostlonglong\fR); +.fi + +.LP +.nf +\fBuint16_t\fR \fBhtons\fR(\fBuint16_t\fR \fIhostshort\fR); +.fi + +.LP +.nf +\fBuint32_t\fR \fBntohl\fR(\fBuint32_t\fR \fInetlong\fR); +.fi + +.LP +.nf +\fBuint64_t\fR \fBntonll\fR(\fBuint64_t\fR \fIhostlonglong\fR); +.fi + +.LP +.nf +\fBuint16_t\fR \fBntohs\fR(\fBuint16_t\fR \fInetshort\fR); +.fi + +.SH DESCRIPTION +.sp +.LP +These functions convert 16-bit, 32-bit, and 64-bit quantities between network +byte order and host byte order. On some architectures these routines are +defined as \fINULL\fR macros in the include file <\fBnetinet/in.h\fR>. On other +architectures, the routines are functional when the host byte order is +different from network byte order. +.sp +.LP +These functions are most often used in conjunction with Internet addresses and +ports as returned by \fBgethostent()\fR and \fBgetservent()\fR. See +\fBgethostbyname\fR(3NSL) and \fBgetservbyname\fR(3SOCKET). +.SH ATTRIBUTES +.sp +.LP +See \fBattributes\fR(5) for descriptions of the following attributes: +.sp + +.sp +.TS +tab() box; +cw(2.75i) |cw(2.75i) +lw(2.75i) |lw(2.75i) +. +ATTRIBUTE TYPEATTRIBUTE VALUE +_ +MT-LevelSafe +.TE + +.SH SEE ALSO +.sp +.LP +\fBgethostbyname\fR(3NSL), \fBgetservbyname\fR(3SOCKET), \fBinet.h\fR(3HEAD), +\fBattributes\fR(5) -- cgit v1.2.3