mirror of https://github.com/mkerrisk/man-pages
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 <mtk.manpages@gmail.com>
This commit is contained in:
parent
f7c494fb23
commit
a2b8b6d657
|
@ -62,7 +62,7 @@
|
|||
.\" Modified 1998, 1999 by Andi Kleen
|
||||
.\" Modified 2004-06-23 by Michael Kerrisk <mtk.manpages@gmail.com>
|
||||
.\"
|
||||
.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 <sys/socket.h>
|
||||
.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 ()
|
||||
|
|
|
@ -43,25 +43,25 @@ getpeername \- get name of connected peer socket
|
|||
.SH SYNOPSIS
|
||||
.B #include <sys/socket.h>
|
||||
.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
|
||||
|
|
|
@ -42,25 +42,25 @@ getsockname \- get socket name
|
|||
.nf
|
||||
.B #include <sys/socket.h>
|
||||
.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
|
||||
|
|
Loading…
Reference in New Issue