recv.2, send.2: Make names of "address" and "address length" args more consistent

Make the names of these arguments more consistent with other
sockets man pages.

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
This commit is contained in:
Michael Kerrisk 2008-12-03 15:42:47 -05:00
parent a2b8b6d657
commit 6926dbf541
2 changed files with 18 additions and 18 deletions

View File

@ -50,7 +50,7 @@ recv, recvfrom, recvmsg \- receive a message from a socket
.BI "ssize_t recv(int " sockfd ", void *" buf ", size_t " len ", int " flags );
.sp
.BI "ssize_t recvfrom(int " sockfd ", void *" buf ", size_t " len ", int " flags ,
.BI " struct sockaddr *" from ", socklen_t *" fromlen );
.BI " struct sockaddr *" src_addr ", socklen_t *" addrlen );
.sp
.BI "ssize_t recvmsg(int " sockfd ", struct msghdr *" msg ", int " flags );
.fi
@ -63,32 +63,32 @@ calls are used to receive messages from a socket, and may be used
to receive data on a socket whether or not it is connection-oriented.
.PP
If
.I from
.I src_addr
is not NULL, and the underlying protocol provides the source address,
this source address is filled in.
When
.I from
.I src_addr
is NULL, nothing is filled in; in this case,
.I fromlen
.I addrlen
is not used, and should also be NULL.
.\" (Note: for datagram sockets in both the Unix and Internet domains,
.\" .I from
.\" .I src_addr
.\" is filled in.
.\" .I from
.\" .I src_addr
.\" is also filled in for stream sockets in the Unix domain, but is not
.\" filled in for stream sockets in the Internet domain.)
.\" [The above notes on AF_UNIX and AF_INET sockets apply as at
.\" Kernel 2.4.18. (MTK, 22 Jul 02)]
The argument
.I fromlen
.I addrlen
is a value-result argument,
which the caller should initialize before the call to
the size of the buffer associated with
.IR from ,
.IR src_addr ,
and modified on return to indicate the actual size of the source address.
The returned address is truncated if the buffer provided is too small;
in this case,
.I fromlen
.I addrlen
will return a value greater than was supplied to the call.
.PP
The
@ -100,7 +100,7 @@ socket (see
and is identical to
.BR recvfrom ()
with a NULL
.I from
.I src_addr
argument.
.PP
All three routines return the length of the message on successful
@ -414,7 +414,7 @@ any data were available; see
.TP
.B EINVAL
Invalid argument passed.
.\" e.g., msg_namelen < 0 for recvmsg() or fromlen < 0 for recvfrom()
.\" e.g., msg_namelen < 0 for recvmsg() or addrlen < 0 for recvfrom()
.TP
.B ENOMEM
Could not allocate memory for
@ -452,7 +452,7 @@ The
.I len
argument is \fIint\fP in 4.x BSD, but \fIsize_t\fP in libc4 and libc5.
The
.I fromlen
.I addrlen
argument is \fIint\ *\fP in 4.x BSD, libc4 and libc5.
The present \fIsocklen_t\ *\fP was invented by POSIX.
See also

View File

@ -48,7 +48,7 @@ send, sendto, sendmsg \- send a message on a socket
.BI "ssize_t sendto(int " sockfd ", const void *" buf ", size_t " len \
", int " flags ,
.BI " const struct sockaddr *" to ", socklen_t " tolen );
.BI " const struct sockaddr *" dest_addr ", socklen_t " addrlen );
.BI "ssize_t sendmsg(int " sockfd ", const struct msghdr *" msg \
", int " flags );
@ -93,9 +93,9 @@ is used on a connection-mode
.RB ( SOCK_STREAM ,
.BR SOCK_SEQPACKET )
socket, the arguments
.I to
.I dest_addr
and
.I tolen
.I addrlen
are ignored (and the error
.B EISCONN
may be returned when they are
@ -103,9 +103,9 @@ not NULL and 0), and the error
.B ENOTCONN
is returned when the socket was not actually connected.
Otherwise, the address of the target is given by
.I to
.I dest_addr
with
.I tolen
.I addrlen
specifying its size.
For
.BR sendmsg (),
@ -370,7 +370,7 @@ the
.I len
argument was \fIint\fP in 4.x BSD and libc4, but \fIsize_t\fP in libc5;
the
.I tolen
.I addrlen
argument was \fIint\fP in 4.x BSD and libc4 and libc5.
See also
.BR accept (2).