mirror of https://github.com/mkerrisk/man-pages
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:
parent
a2b8b6d657
commit
6926dbf541
24
man2/recv.2
24
man2/recv.2
|
@ -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 );
|
.BI "ssize_t recv(int " sockfd ", void *" buf ", size_t " len ", int " flags );
|
||||||
.sp
|
.sp
|
||||||
.BI "ssize_t recvfrom(int " sockfd ", void *" buf ", size_t " len ", int " flags ,
|
.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
|
.sp
|
||||||
.BI "ssize_t recvmsg(int " sockfd ", struct msghdr *" msg ", int " flags );
|
.BI "ssize_t recvmsg(int " sockfd ", struct msghdr *" msg ", int " flags );
|
||||||
.fi
|
.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.
|
to receive data on a socket whether or not it is connection-oriented.
|
||||||
.PP
|
.PP
|
||||||
If
|
If
|
||||||
.I from
|
.I src_addr
|
||||||
is not NULL, and the underlying protocol provides the source address,
|
is not NULL, and the underlying protocol provides the source address,
|
||||||
this source address is filled in.
|
this source address is filled in.
|
||||||
When
|
When
|
||||||
.I from
|
.I src_addr
|
||||||
is NULL, nothing is filled in; in this case,
|
is NULL, nothing is filled in; in this case,
|
||||||
.I fromlen
|
.I addrlen
|
||||||
is not used, and should also be NULL.
|
is not used, and should also be NULL.
|
||||||
.\" (Note: for datagram sockets in both the Unix and Internet domains,
|
.\" (Note: for datagram sockets in both the Unix and Internet domains,
|
||||||
.\" .I from
|
.\" .I src_addr
|
||||||
.\" is filled in.
|
.\" is filled in.
|
||||||
.\" .I from
|
.\" .I src_addr
|
||||||
.\" is also filled in for stream sockets in the Unix domain, but is not
|
.\" is also filled in for stream sockets in the Unix domain, but is not
|
||||||
.\" filled in for stream sockets in the Internet domain.)
|
.\" filled in for stream sockets in the Internet domain.)
|
||||||
.\" [The above notes on AF_UNIX and AF_INET sockets apply as at
|
.\" [The above notes on AF_UNIX and AF_INET sockets apply as at
|
||||||
.\" Kernel 2.4.18. (MTK, 22 Jul 02)]
|
.\" Kernel 2.4.18. (MTK, 22 Jul 02)]
|
||||||
The argument
|
The argument
|
||||||
.I fromlen
|
.I addrlen
|
||||||
is a value-result argument,
|
is a value-result argument,
|
||||||
which the caller should initialize before the call to
|
which the caller should initialize before the call to
|
||||||
the size of the buffer associated with
|
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.
|
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;
|
The returned address is truncated if the buffer provided is too small;
|
||||||
in this case,
|
in this case,
|
||||||
.I fromlen
|
.I addrlen
|
||||||
will return a value greater than was supplied to the call.
|
will return a value greater than was supplied to the call.
|
||||||
.PP
|
.PP
|
||||||
The
|
The
|
||||||
|
@ -100,7 +100,7 @@ socket (see
|
||||||
and is identical to
|
and is identical to
|
||||||
.BR recvfrom ()
|
.BR recvfrom ()
|
||||||
with a NULL
|
with a NULL
|
||||||
.I from
|
.I src_addr
|
||||||
argument.
|
argument.
|
||||||
.PP
|
.PP
|
||||||
All three routines return the length of the message on successful
|
All three routines return the length of the message on successful
|
||||||
|
@ -414,7 +414,7 @@ any data were available; see
|
||||||
.TP
|
.TP
|
||||||
.B EINVAL
|
.B EINVAL
|
||||||
Invalid argument passed.
|
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
|
.TP
|
||||||
.B ENOMEM
|
.B ENOMEM
|
||||||
Could not allocate memory for
|
Could not allocate memory for
|
||||||
|
@ -452,7 +452,7 @@ The
|
||||||
.I len
|
.I len
|
||||||
argument is \fIint\fP in 4.x BSD, but \fIsize_t\fP in libc4 and libc5.
|
argument is \fIint\fP in 4.x BSD, but \fIsize_t\fP in libc4 and libc5.
|
||||||
The
|
The
|
||||||
.I fromlen
|
.I addrlen
|
||||||
argument is \fIint\ *\fP in 4.x BSD, libc4 and libc5.
|
argument is \fIint\ *\fP in 4.x BSD, libc4 and libc5.
|
||||||
The present \fIsocklen_t\ *\fP was invented by POSIX.
|
The present \fIsocklen_t\ *\fP was invented by POSIX.
|
||||||
See also
|
See also
|
||||||
|
|
12
man2/send.2
12
man2/send.2
|
@ -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 \
|
.BI "ssize_t sendto(int " sockfd ", const void *" buf ", size_t " len \
|
||||||
", int " flags ,
|
", 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 \
|
.BI "ssize_t sendmsg(int " sockfd ", const struct msghdr *" msg \
|
||||||
", int " flags );
|
", int " flags );
|
||||||
|
@ -93,9 +93,9 @@ is used on a connection-mode
|
||||||
.RB ( SOCK_STREAM ,
|
.RB ( SOCK_STREAM ,
|
||||||
.BR SOCK_SEQPACKET )
|
.BR SOCK_SEQPACKET )
|
||||||
socket, the arguments
|
socket, the arguments
|
||||||
.I to
|
.I dest_addr
|
||||||
and
|
and
|
||||||
.I tolen
|
.I addrlen
|
||||||
are ignored (and the error
|
are ignored (and the error
|
||||||
.B EISCONN
|
.B EISCONN
|
||||||
may be returned when they are
|
may be returned when they are
|
||||||
|
@ -103,9 +103,9 @@ not NULL and 0), and the error
|
||||||
.B ENOTCONN
|
.B ENOTCONN
|
||||||
is returned when the socket was not actually connected.
|
is returned when the socket was not actually connected.
|
||||||
Otherwise, the address of the target is given by
|
Otherwise, the address of the target is given by
|
||||||
.I to
|
.I dest_addr
|
||||||
with
|
with
|
||||||
.I tolen
|
.I addrlen
|
||||||
specifying its size.
|
specifying its size.
|
||||||
For
|
For
|
||||||
.BR sendmsg (),
|
.BR sendmsg (),
|
||||||
|
@ -370,7 +370,7 @@ the
|
||||||
.I len
|
.I len
|
||||||
argument was \fIint\fP in 4.x BSD and libc4, but \fIsize_t\fP in libc5;
|
argument was \fIint\fP in 4.x BSD and libc4, but \fIsize_t\fP in libc5;
|
||||||
the
|
the
|
||||||
.I tolen
|
.I addrlen
|
||||||
argument was \fIint\fP in 4.x BSD and libc4 and libc5.
|
argument was \fIint\fP in 4.x BSD and libc4 and libc5.
|
||||||
See also
|
See also
|
||||||
.BR accept (2).
|
.BR accept (2).
|
||||||
|
|
Loading…
Reference in New Issue