Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/lib/libc/sys Note STANDARDS and use more markup.
details: https://anonhg.NetBSD.org/src/rev/8c31e52e8796
branches: trunk
changeset: 765699:8c31e52e8796
user: jruoho <jruoho%NetBSD.org@localhost>
date: Fri Jun 03 05:50:07 2011 +0000
description:
Note STANDARDS and use more markup.
diffstat:
lib/libc/sys/getpeername.2 | 28 +++++++++++++++-------------
1 files changed, 15 insertions(+), 13 deletions(-)
diffs (76 lines):
diff -r 6952169069d5 -r 8c31e52e8796 lib/libc/sys/getpeername.2
--- a/lib/libc/sys/getpeername.2 Fri Jun 03 05:42:09 2011 +0000
+++ b/lib/libc/sys/getpeername.2 Fri Jun 03 05:50:07 2011 +0000
@@ -1,4 +1,4 @@
-.\" $NetBSD: getpeername.2,v 1.19 2006/03/05 22:06:08 agc Exp $
+.\" $NetBSD: getpeername.2,v 1.20 2011/06/03 05:50:07 jruoho Exp $
.\"
.\" Copyright (c) 1983, 1991, 1993
.\" The Regents of the University of California. All rights reserved.
@@ -29,7 +29,7 @@
.\"
.\" @(#)getpeername.2 8.1 (Berkeley) 6/4/93
.\"
-.Dd March 5, 2006
+.Dd June 3, 2011
.Dt GETPEERNAME 2
.Os
.Sh NAME
@@ -40,11 +40,12 @@
.Sh SYNOPSIS
.In sys/socket.h
.Ft int
-.Fn getpeername "int s" "struct sockaddr * restrict name" "socklen_t * restrict namelen"
+.Fn getpeername \
+"int s" "struct sockaddr * restrict name" "socklen_t * restrict namelen"
.Sh DESCRIPTION
+The
.Fn getpeername
-returns the name of the peer connected to
-socket
+function returns the name of the peer connected to the socket
.Fa s .
One common use occurs when a process inherits an open socket, such as
TCP servers forked from
@@ -53,13 +54,11 @@
.Fn getpeername
is used to determine the connecting client's IP address.
.Pp
-.Fn getpeername
-takes three parameters:
-.Pp
-.Fa s
+The function takes three parameters:
+.Bl -tag -width namelen -offset indent
+.It Fa s
contains the file descriptor of the socket whose peer should be looked up.
-.Pp
-.Fa name
+.It Fa name
points to a
.Li sockaddr
structure that will hold the address information for the connected peer.
@@ -77,11 +76,11 @@
is large enough to hold any of the other sockaddr_* variants.
On return, it can be cast to the correct sockaddr type,
based on the protocol family contained in its ss_family field.
-.Pp
-.Fa namelen
+.It Fa namelen
indicates the amount of space pointed to by
.Fa name ,
in bytes.
+.El
.Pp
If address information for the local end of the socket is required, the
.Xr getsockname 2
@@ -128,6 +127,9 @@
.Xr bind 2 ,
.Xr getsockname 2 ,
.Xr socket 2
+.Sh STANDARDS
+The function conforms to
+.St -p1003.1-2008 .
.Sh HISTORY
The
.Fn getpeername
Home |
Main Index |
Thread Index |
Old Index