From a2b8b6d657300688a2c1f13e8623418bf1fb494c Mon Sep 17 00:00:00 2001 From: Michael Kerrisk Date: Wed, 3 Dec 2008 15:36:34 -0500 Subject: [PATCH] connect.2, getpeername.2, getsockname.2: Use consistent argument names Most other sockets pages are using the names 'addr' and 'addrlen'; make these pages do the same. Signed-off-by: Michael Kerrisk --- man2/connect.2 | 14 +++++++------- man2/getpeername.2 | 16 ++++++++-------- man2/getsockname.2 | 16 ++++++++-------- 3 files changed, 23 insertions(+), 23 deletions(-) diff --git a/man2/connect.2 b/man2/connect.2 index bb3894618..1fd5293fe 100644 --- a/man2/connect.2 +++ b/man2/connect.2 @@ -62,7 +62,7 @@ .\" Modified 1998, 1999 by Andi Kleen .\" Modified 2004-06-23 by Michael Kerrisk .\" -.TH CONNECT 2 2008-11-20 "Linux" "Linux Programmer's Manual" +.TH CONNECT 2 2008-12-03 "Linux" "Linux Programmer's Manual" .SH NAME connect \- initiate a connection on a socket .SH SYNOPSIS @@ -71,7 +71,7 @@ connect \- initiate a connection on a socket .br .B #include .sp -.BI "int connect(int " sockfd ", const struct sockaddr *" serv_addr , +.BI "int connect(int " sockfd ", const struct sockaddr *" addr , .BI " socklen_t " addrlen ); .fi .SH DESCRIPTION @@ -80,13 +80,13 @@ The system call connects the socket referred to by the file descriptor .I sockfd to the address specified by -.IR serv_addr . +.IR addr . The .I addrlen argument specifies the size of -.IR serv_addr . +.IR addr . The format of the address in -.I serv_addr +.I addr is determined by the address space of the socket .IR sockfd ; see @@ -98,7 +98,7 @@ If the socket is of type .B SOCK_DGRAM then -.I serv_addr +.I addr is the address to which datagrams are sent by default, and the only address from which datagrams are received. If the socket is of type @@ -107,7 +107,7 @@ or .BR SOCK_SEQPACKET , this call attempts to make a connection to the socket that is bound to the address specified by -.IR serv_addr . +.IR addr . .PP Generally, connection-based protocol sockets may successfully .BR connect () diff --git a/man2/getpeername.2 b/man2/getpeername.2 index ed9a5fd8f..9ae39f8f4 100644 --- a/man2/getpeername.2 +++ b/man2/getpeername.2 @@ -43,25 +43,25 @@ getpeername \- get name of connected peer socket .SH SYNOPSIS .B #include .sp -.BI "int getpeername(int " sockfd ", struct sockaddr *" name \ -", socklen_t *" namelen ); +.BI "int getpeername(int " sockfd ", struct sockaddr *" addr \ +", socklen_t *" addrlen ); .SH DESCRIPTION .BR getpeername () returns the address of the peer connected to the socket .IR sockfd , in the buffer pointed to by -.IR name . +.IR addr . The -.I namelen +.I addrlen argument should be initialized to indicate the amount of space pointed to by -.IR name . +.IR addr . On return it contains the actual size of the name returned (in bytes). The name is truncated if the buffer provided is too small. The returned address is truncated if the buffer provided is too small; in this case, -.I namelen +.I addrlen will return a value greater than was supplied to the call. .SH "RETURN VALUE" On success, zero is returned. @@ -77,12 +77,12 @@ is not a valid descriptor. .TP .B EFAULT The -.I name +.I addr argument points to memory not in a valid part of the process address space. .TP .B EINVAL -.I namelen +.I addrlen is invalid (e.g., is negative). .TP .B ENOBUFS diff --git a/man2/getsockname.2 b/man2/getsockname.2 index fa92a4fe9..a24f69c7c 100644 --- a/man2/getsockname.2 +++ b/man2/getsockname.2 @@ -42,25 +42,25 @@ getsockname \- get socket name .nf .B #include .sp -.BI "int getsockname(int " sockfd ", struct sockaddr *" name \ -", socklen_t *" namelen ); +.BI "int getsockname(int " sockfd ", struct sockaddr *" addr \ +", socklen_t *" addrlen ); .fi .SH DESCRIPTION .BR getsockname () returns the current address to which the socket .I sockfd is bound, in the buffer pointed to by -.IR name . +.IR addr . The -.I namelen +.I addrlen argument should be initialized to indicate the amount of space (in bytes) pointed to by -.IR name . +.IR addr . On return it contains the actual size of the socket address. The returned address is truncated if the buffer provided is too small; in this case, -.I namelen +.I addrlen will return a value greater than was supplied to the call. .SH "RETURN VALUE" On success, zero is returned. @@ -76,12 +76,12 @@ is not a valid descriptor. .TP .B EFAULT The -.I name +.I addr argument points to memory not in a valid part of the process address space. .TP .B EINVAL -.I namelen +.I addrlen is invalid (e.g., is negative). .TP .B ENOBUFS