man-pages/man2/recv.2.html
2021-03-31 01:06:50 +01:00

777 lines
20 KiB
HTML

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<HTML><HEAD><TITLE>Man page of RECV</TITLE>
</HEAD><BODY>
<H1>RECV</H1>
Section: Linux Programmer's Manual (2)<BR>Updated: 2017-09-15<BR><A HREF="#index">Index</A>
<A HREF="/cgi-bin/man/man2html">Return to Main Contents</A><HR>
<A NAME="lbAB">&nbsp;</A>
<H2>NAME</H2>
recv, recvfrom, recvmsg - receive a message from a socket
<A NAME="lbAC">&nbsp;</A>
<H2>SYNOPSIS</H2>
<PRE>
<B>#include &lt;<A HREF="file:///usr/include/sys/types.h">sys/types.h</A>&gt;</B>
<BR>
<B>#include &lt;<A HREF="file:///usr/include/sys/socket.h">sys/socket.h</A>&gt;</B>
<B>ssize_t recv(int </B><I>sockfd</I><B>, void *</B><I>buf</I><B>, size_t </B><I>len</I><B>, int </B><I>flags</I><B>);</B>
<B>ssize_t recvfrom(int </B><I>sockfd</I><B>, void *</B><I>buf</I><B>, size_t </B><I>len</I><B>, int </B><I>flags</I><B>,</B>
<B> struct sockaddr *</B><I>src_addr</I><B>, socklen_t *</B><I>addrlen</I><B>);</B>
<B>ssize_t recvmsg(int </B><I>sockfd</I><B>, struct msghdr *</B><I>msg</I><B>, int </B><I>flags</I><B>);</B>
</PRE>
<A NAME="lbAD">&nbsp;</A>
<H2>DESCRIPTION</H2>
The
<B>recv</B>(),
<B>recvfrom</B>(),
and
<B>recvmsg</B>()
calls are used to receive messages from a socket.
They may be used
to receive data on both connectionless and connection-oriented sockets.
This page first describes common features of all three system calls,
and then describes the differences between the calls.
<P>
The only difference between
<B>recv</B>()
and
<B><A HREF="/cgi-bin/man/man2html?2+read">read</A></B>(2)
is the presence of
<I>flags</I>.
With a zero
<I>flags</I>
argument,
<B>recv</B>()
is generally equivalent to
<B><A HREF="/cgi-bin/man/man2html?2+read">read</A></B>(2)
(but see NOTES).
Also, the following call
<P>
<BR>&nbsp;&nbsp;&nbsp;&nbsp;recv(sockfd,&nbsp;buf,&nbsp;len,&nbsp;flags);
<P>
is equivalent to
<P>
<BR>&nbsp;&nbsp;&nbsp;&nbsp;recvfrom(sockfd,&nbsp;buf,&nbsp;len,&nbsp;flags,&nbsp;NULL,&nbsp;NULL);
<P>
All three calls return the length of the message on successful
completion.
If a message is too long to fit in the supplied buffer, excess
bytes may be discarded depending on the type of socket the message is
received from.
<P>
If no messages are available at the socket, the receive calls wait for a
message to arrive, unless the socket is nonblocking (see
<B><A HREF="/cgi-bin/man/man2html?2+fcntl">fcntl</A></B>(2)),
in which case the value -1 is returned and the external variable
<I>errno</I>
is set to
<B>EAGAIN</B> or <B>EWOULDBLOCK</B>.
The receive calls normally return any data available, up to the requested
amount, rather than waiting for receipt of the full amount requested.
<P>
An application can use
<B><A HREF="/cgi-bin/man/man2html?2+select">select</A></B>(2),
<B><A HREF="/cgi-bin/man/man2html?2+poll">poll</A></B>(2),
or
<B><A HREF="/cgi-bin/man/man2html?7+epoll">epoll</A></B>(7)
to determine when more data arrives on a socket.
<A NAME="lbAE">&nbsp;</A>
<H3>The flags argument</H3>
The
<I>flags</I>
argument is formed by ORing one or more of the following values:
<DL COMPACT>
<DT id="1"><B>MSG_CMSG_CLOEXEC</B> (<B>recvmsg</B>() only; since Linux 2.6.23)
<DD>
Set the close-on-exec flag for the file descriptor received
via a UNIX domain file descriptor using the
<B>SCM_RIGHTS</B>
operation (described in
<B><A HREF="/cgi-bin/man/man2html?7+unix">unix</A></B>(7)).
This flag is useful for the same reasons as the
<B>O_CLOEXEC</B>
flag of
<B><A HREF="/cgi-bin/man/man2html?2+open">open</A></B>(2).
<DT id="2"><B>MSG_DONTWAIT</B> (since Linux 2.2)
<DD>
Enables nonblocking operation; if the operation would block,
the call fails with the error
<B>EAGAIN</B> or <B>EWOULDBLOCK</B>.
This provides similar behavior to setting the
<B>O_NONBLOCK</B>
flag (via the
<B><A HREF="/cgi-bin/man/man2html?2+fcntl">fcntl</A></B>(2)
<B>F_SETFL</B>
operation), but differs in that
<B>MSG_DONTWAIT</B>
is a per-call option, whereas
<B>O_NONBLOCK</B>
is a setting on the open file description (see
<B><A HREF="/cgi-bin/man/man2html?2+open">open</A></B>(2)),
which will affect all threads in the calling process
and as well as other processes that hold file descriptors
referring to the same open file description.
<DT id="3"><B>MSG_ERRQUEUE</B> (since Linux 2.2)
<DD>
This flag
specifies that queued errors should be received from the socket error queue.
The error is passed in
an ancillary message with a type dependent on the protocol (for IPv4
<B>IP_RECVERR</B>).
The user should supply a buffer of sufficient size.
See
<B><A HREF="/cgi-bin/man/man2html?3+cmsg">cmsg</A></B>(3)
and
<B><A HREF="/cgi-bin/man/man2html?7+ip">ip</A></B>(7)
for more information.
The payload of the original packet that caused the error
is passed as normal data via
<I>msg_iovec</I>.
The original destination address of the datagram that caused the error
is supplied via
<I>msg_name</I>.
<DT id="4"><DD>
The error is supplied in a
<I>sock_extended_err</I>
structure:
<DT id="5"><DD>
#define SO_EE_ORIGIN_NONE 0
#define SO_EE_ORIGIN_LOCAL 1
#define SO_EE_ORIGIN_ICMP 2
#define SO_EE_ORIGIN_ICMP6 3
<P>
struct sock_extended_err
{
<BR>&nbsp;&nbsp;&nbsp;&nbsp;uint32_t&nbsp;ee_errno;&nbsp;&nbsp;&nbsp;/*&nbsp;Error&nbsp;number&nbsp;*/
<BR>&nbsp;&nbsp;&nbsp;&nbsp;uint8_t&nbsp;&nbsp;ee_origin;&nbsp;&nbsp;/*&nbsp;Where&nbsp;the&nbsp;error&nbsp;originated&nbsp;*/
<BR>&nbsp;&nbsp;&nbsp;&nbsp;uint8_t&nbsp;&nbsp;ee_type;&nbsp;&nbsp;&nbsp;&nbsp;/*&nbsp;Type&nbsp;*/
<BR>&nbsp;&nbsp;&nbsp;&nbsp;uint8_t&nbsp;&nbsp;ee_code;&nbsp;&nbsp;&nbsp;&nbsp;/*&nbsp;Code&nbsp;*/
<BR>&nbsp;&nbsp;&nbsp;&nbsp;uint8_t&nbsp;&nbsp;ee_pad;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;/*&nbsp;Padding&nbsp;*/
<BR>&nbsp;&nbsp;&nbsp;&nbsp;uint32_t&nbsp;ee_info;&nbsp;&nbsp;&nbsp;&nbsp;/*&nbsp;Additional&nbsp;information&nbsp;*/
<BR>&nbsp;&nbsp;&nbsp;&nbsp;uint32_t&nbsp;ee_data;&nbsp;&nbsp;&nbsp;&nbsp;/*&nbsp;Other&nbsp;data&nbsp;*/
<BR>&nbsp;&nbsp;&nbsp;&nbsp;/*&nbsp;More&nbsp;data&nbsp;may&nbsp;follow&nbsp;*/
};
<P>
struct sockaddr *SO_EE_OFFENDER(struct sock_extended_err *);
<DT id="6"><DD>
<I>ee_errno</I>
contains the
<I>errno</I>
number of the queued error.
<I>ee_origin</I>
is the origin code of where the error originated.
The other fields are protocol-specific.
The macro
<B>SOCK_EE_OFFENDER</B>
returns a pointer to the address of the network object
where the error originated from given a pointer to the ancillary message.
If this address is not known, the
<I>sa_family</I>
member of the
<I>sockaddr</I>
contains
<B>AF_UNSPEC</B>
and the other fields of the
<I>sockaddr</I>
are undefined.
The payload of the packet that caused the error is passed as normal data.
<DT id="7"><DD>
For local errors, no address is passed (this
can be checked with the
<I>cmsg_len</I>
member of the
<I>cmsghdr</I>).
For error receives,
the
<B>MSG_ERRQUEUE</B>
flag is set in the
<I>msghdr</I>.
After an error has been passed, the pending socket error
is regenerated based on the next queued error and will be passed
on the next socket operation.
<DT id="8"><B>MSG_OOB</B>
<DD>
This flag requests receipt of out-of-band data that would not be received
in the normal data stream.
Some protocols place expedited data
at the head of the normal data queue, and thus this flag cannot
be used with such protocols.
<DT id="9"><B>MSG_PEEK</B>
<DD>
This flag causes the receive operation to
return data from the beginning of the
receive queue without removing that data from the queue.
Thus, a
subsequent receive call will return the same data.
<DT id="10"><B>MSG_TRUNC</B> (since Linux 2.2)
<DD>
For raw
(<B>AF_PACKET</B>),
Internet datagram (since Linux 2.4.27/2.6.8),
netlink (since Linux 2.6.22), and UNIX datagram
(since Linux 3.4) sockets:
return the real length of the packet or datagram,
even when it was longer than the passed buffer.
<DT id="11"><DD>
For use with Internet stream sockets, see
<B><A HREF="/cgi-bin/man/man2html?7+tcp">tcp</A></B>(7).
<DT id="12"><B>MSG_WAITALL</B> (since Linux 2.2)
<DD>
This flag requests that the operation block until the full request is
satisfied.
However, the call may still return less data than requested if
a signal is caught, an error or disconnect occurs, or the next data to be
received is of a different type than that returned.
This flag has no effect for datagram sockets.
</DL>
<A NAME="lbAF">&nbsp;</A>
<H3>recvfrom()</H3>
<B>recvfrom</B>()
places the received message into the buffer
<I>buf</I>.
The caller must specify the size of the buffer in
<I>len</I>.
<P>
If
<I>src_addr</I>
is not NULL,
and the underlying protocol provides the source address of the message,
that source address is placed in the buffer pointed to by
<I>src_addr</I>.
In this case,
<I>addrlen</I>
is a value-result argument.
Before the call,
it should be initialized to the size of the buffer associated with
<I>src_addr</I>.
Upon return,
<I>addrlen</I>
is updated to contain the actual size of the source address.
The returned address is truncated if the buffer provided is too small;
in this case,
<I>addrlen</I>
will return a value greater than was supplied to the call.
<P>
If the caller is not interested in the source address,
<I>src_addr</I>
and
<I>addrlen</I>
should be specified as NULL.
<A NAME="lbAG">&nbsp;</A>
<H3>recv()</H3>
The
<B>recv</B>()
call is normally used only on a
<I>connected</I>
socket (see
<B><A HREF="/cgi-bin/man/man2html?2+connect">connect</A></B>(2)).
It is equivalent to the call:
<P>
<BR>&nbsp;&nbsp;&nbsp;&nbsp;recvfrom(fd,&nbsp;buf,&nbsp;len,&nbsp;flags,&nbsp;NULL,&nbsp;0);
<A NAME="lbAH">&nbsp;</A>
<H3>recvmsg()</H3>
The
<B>recvmsg</B>()
call uses a
<I>msghdr</I>
structure to minimize the number of directly supplied arguments.
This structure is defined as follows in
<I>&lt;<A HREF="file:///usr/include/sys/socket.h">sys/socket.h</A>&gt;</I>:
<P>
struct iovec { /* Scatter/gather array items */
<BR>&nbsp;&nbsp;&nbsp;&nbsp;void&nbsp;&nbsp;*iov_base;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;/*&nbsp;Starting&nbsp;address&nbsp;*/
<BR>&nbsp;&nbsp;&nbsp;&nbsp;size_t&nbsp;iov_len;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;/*&nbsp;Number&nbsp;of&nbsp;bytes&nbsp;to&nbsp;transfer&nbsp;*/
};
<P>
struct msghdr {
<BR>&nbsp;&nbsp;&nbsp;&nbsp;void&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*msg_name;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;/*&nbsp;Optional&nbsp;address&nbsp;*/
<BR>&nbsp;&nbsp;&nbsp;&nbsp;socklen_t&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;msg_namelen;&nbsp;&nbsp;&nbsp;&nbsp;/*&nbsp;Size&nbsp;of&nbsp;address&nbsp;*/
<BR>&nbsp;&nbsp;&nbsp;&nbsp;struct&nbsp;iovec&nbsp;*msg_iov;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;/*&nbsp;Scatter/gather&nbsp;array&nbsp;*/
<BR>&nbsp;&nbsp;&nbsp;&nbsp;size_t&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;msg_iovlen;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;/*&nbsp;#&nbsp;elements&nbsp;in&nbsp;msg_iov&nbsp;*/
<BR>&nbsp;&nbsp;&nbsp;&nbsp;void&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*msg_control;&nbsp;&nbsp;&nbsp;&nbsp;/*&nbsp;Ancillary&nbsp;data,&nbsp;see&nbsp;below&nbsp;*/
<BR>&nbsp;&nbsp;&nbsp;&nbsp;size_t&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;msg_controllen;&nbsp;/*&nbsp;Ancillary&nbsp;data&nbsp;buffer&nbsp;len&nbsp;*/
<BR>&nbsp;&nbsp;&nbsp;&nbsp;int&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;msg_flags;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;/*&nbsp;Flags&nbsp;on&nbsp;received&nbsp;message&nbsp;*/
};
<P>
The
<I>msg_name</I>
field points to a caller-allocated buffer that is used to
return the source address if the socket is unconnected.
The caller should set
<I>msg_namelen</I>
to the size of this buffer before this call;
upon return from a successful call,
<I>msg_namelen</I>
will contain the length of the returned address.
If the application does not need to know the source address,
<I>msg_name</I>
can be specified as NULL.
<P>
The fields
<I>msg_iov</I>
and
<I>msg_iovlen</I>
describe scatter-gather locations, as discussed in
<B><A HREF="/cgi-bin/man/man2html?2+readv">readv</A></B>(2).
<P>
The field
<I>msg_control</I>,
which has length
<I>msg_controllen</I>,
points to a buffer for other protocol control-related messages or
miscellaneous ancillary data.
When
<B>recvmsg</B>()
is called,
<I>msg_controllen</I>
should contain the length of the available buffer in
<I>msg_control</I>;
upon return from a successful call it will contain the length
of the control message sequence.
<P>
The messages are of the form:
<P>
struct cmsghdr {
<BR>&nbsp;&nbsp;&nbsp;&nbsp;size_t&nbsp;cmsg_len;&nbsp;&nbsp;&nbsp;&nbsp;/*&nbsp;Data&nbsp;byte&nbsp;count,&nbsp;including&nbsp;header
<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(type&nbsp;is&nbsp;socklen_t&nbsp;in&nbsp;POSIX)&nbsp;*/
<BR>&nbsp;&nbsp;&nbsp;&nbsp;int&nbsp;&nbsp;&nbsp;&nbsp;cmsg_level;&nbsp;&nbsp;/*&nbsp;Originating&nbsp;protocol&nbsp;*/
<BR>&nbsp;&nbsp;&nbsp;&nbsp;int&nbsp;&nbsp;&nbsp;&nbsp;cmsg_type;&nbsp;&nbsp;&nbsp;/*&nbsp;Protocol-specific&nbsp;type&nbsp;*/
/* followed by
<BR>&nbsp;&nbsp;&nbsp;&nbsp;unsigned&nbsp;char&nbsp;cmsg_data[];&nbsp;*/
};
<P>
Ancillary data should be accessed only by the macros defined in
<B><A HREF="/cgi-bin/man/man2html?3+cmsg">cmsg</A></B>(3).
<P>
As an example, Linux uses this ancillary data mechanism to pass extended
errors, IP options, or file descriptors over UNIX domain sockets.
<P>
The
<I>msg_flags</I>
field in the
<I>msghdr</I>
is set on return of
<B>recvmsg</B>().
It can contain several flags:
<DL COMPACT>
<DT id="13"><B>MSG_EOR</B>
<DD>
indicates end-of-record; the data returned completed a record (generally
used with sockets of type
<B>SOCK_SEQPACKET</B>).
<DT id="14"><B>MSG_TRUNC</B>
<DD>
indicates that the trailing portion of a datagram was discarded because the
datagram was larger than the buffer supplied.
<DT id="15"><B>MSG_CTRUNC</B>
<DD>
indicates that some control data was discarded due to lack of space in the
buffer for ancillary data.
<DT id="16"><B>MSG_OOB</B>
<DD>
is returned to indicate that expedited or out-of-band data was received.
<DT id="17"><B>MSG_ERRQUEUE</B>
<DD>
indicates that no data was received but an extended error from the socket
error queue.
</DL>
<A NAME="lbAI">&nbsp;</A>
<H2>RETURN VALUE</H2>
These calls return the number of bytes received, or -1
if an error occurred.
In the event of an error,
<I>errno</I>
is set to indicate the error.
<P>
When a stream socket peer has performed an orderly shutdown,
the return value will be 0 (the traditional &quot;end-of-file&quot; return).
<P>
Datagram sockets in various domains (e.g., the UNIX and Internet domains)
permit zero-length datagrams.
When such a datagram is received, the return value is 0.
<P>
The value 0 may also be returned if the requested number of bytes
to receive from a stream socket was 0.
<A NAME="lbAJ">&nbsp;</A>
<H2>ERRORS</H2>
These are some standard errors generated by the socket layer.
Additional errors
may be generated and returned from the underlying protocol modules;
see their manual pages.
<DL COMPACT>
<DT id="18"><B>EAGAIN</B> or <B>EWOULDBLOCK</B>
<DD>
The socket is marked nonblocking and the receive operation
would block, or a receive timeout had been set and the timeout expired
before data was received.
POSIX.1 allows either error to be returned for this case,
and does not require these constants to have the same value,
so a portable application should check for both possibilities.
<DT id="19"><B>EBADF</B>
<DD>
The argument
<I>sockfd</I>
is an invalid file descriptor.
<DT id="20"><B>ECONNREFUSED</B>
<DD>
A remote host refused to allow the network connection (typically
because it is not running the requested service).
<DT id="21"><B>EFAULT</B>
<DD>
The receive buffer pointer(s) point outside the process's
address space.
<DT id="22"><B>EINTR</B>
<DD>
The receive was interrupted by delivery of a signal before
any data was available; see
<B><A HREF="/cgi-bin/man/man2html?7+signal">signal</A></B>(7).
<DT id="23"><B>EINVAL</B>
<DD>
Invalid argument passed.
<DT id="24"><B>ENOMEM</B>
<DD>
Could not allocate memory for
<B>recvmsg</B>().
<DT id="25"><B>ENOTCONN</B>
<DD>
The socket is associated with a connection-oriented protocol
and has not been connected (see
<B><A HREF="/cgi-bin/man/man2html?2+connect">connect</A></B>(2)
and
<B><A HREF="/cgi-bin/man/man2html?2+accept">accept</A></B>(2)).
<DT id="26"><B>ENOTSOCK</B>
<DD>
The file descriptor
<I>sockfd</I>
does not refer to a socket.
</DL>
<A NAME="lbAK">&nbsp;</A>
<H2>CONFORMING TO</H2>
POSIX.1-2001, POSIX.1-2008,
4.4BSD (these interfaces first appeared in 4.2BSD).
<P>
POSIX.1 describes only the
<B>MSG_OOB</B>,
<B>MSG_PEEK</B>,
and
<B>MSG_WAITALL</B>
flags.
<A NAME="lbAL">&nbsp;</A>
<H2>NOTES</H2>
If a zero-length datagram is pending,
<B><A HREF="/cgi-bin/man/man2html?2+read">read</A></B>(2)
and
<B>recv</B>()
with a
<I>flags</I>
argument of zero provide different behavior.
In this circumstance,
<B><A HREF="/cgi-bin/man/man2html?2+read">read</A></B>(2)
has no effect (the datagram remains pending), while
<B>recv</B>()
consumes the pending datagram.
<P>
The
<I>socklen_t</I>
type was invented by POSIX.
See also
<B><A HREF="/cgi-bin/man/man2html?2+accept">accept</A></B>(2).
<P>
According to POSIX.1,
the
<I>msg_controllen</I>
field of the
<I>msghdr</I>
structure should be typed as
<I>socklen_t</I>,
but glibc currently types it as
<I>size_t</I>.
<P>
See
<B><A HREF="/cgi-bin/man/man2html?2+recvmmsg">recvmmsg</A></B>(2)
for information about a Linux-specific system call
that can be used to receive multiple datagrams in a single call.
<A NAME="lbAM">&nbsp;</A>
<H2>EXAMPLE</H2>
An example of the use of
<B>recvfrom</B>()
is shown in
<B><A HREF="/cgi-bin/man/man2html?3+getaddrinfo">getaddrinfo</A></B>(3).
<A NAME="lbAN">&nbsp;</A>
<H2>SEE ALSO</H2>
<B><A HREF="/cgi-bin/man/man2html?2+fcntl">fcntl</A></B>(2),
<B><A HREF="/cgi-bin/man/man2html?2+getsockopt">getsockopt</A></B>(2),
<B><A HREF="/cgi-bin/man/man2html?2+read">read</A></B>(2),
<B><A HREF="/cgi-bin/man/man2html?2+recvmmsg">recvmmsg</A></B>(2),
<B><A HREF="/cgi-bin/man/man2html?2+select">select</A></B>(2),
<B><A HREF="/cgi-bin/man/man2html?2+shutdown">shutdown</A></B>(2),
<B><A HREF="/cgi-bin/man/man2html?2+socket">socket</A></B>(2),
<B><A HREF="/cgi-bin/man/man2html?3+cmsg">cmsg</A></B>(3),
<B><A HREF="/cgi-bin/man/man2html?3+sockatmark">sockatmark</A></B>(3),
<B><A HREF="/cgi-bin/man/man2html?7+ip">ip</A></B>(7),
<B><A HREF="/cgi-bin/man/man2html?7+ipv6">ipv6</A></B>(7),
<B><A HREF="/cgi-bin/man/man2html?7+socket">socket</A></B>(7),
<B><A HREF="/cgi-bin/man/man2html?7+tcp">tcp</A></B>(7),
<B><A HREF="/cgi-bin/man/man2html?7+udp">udp</A></B>(7),
<B><A HREF="/cgi-bin/man/man2html?7+unix">unix</A></B>(7)
<A NAME="lbAO">&nbsp;</A>
<H2>COLOPHON</H2>
This page is part of release 5.05 of the Linux
<I>man-pages</I>
project.
A description of the project,
information about reporting bugs,
and the latest version of this page,
can be found at
<A HREF="https://www.kernel.org/doc/man-pages/.">https://www.kernel.org/doc/man-pages/.</A>
<P>
<HR>
<A NAME="index">&nbsp;</A><H2>Index</H2>
<DL>
<DT id="27"><A HREF="#lbAB">NAME</A><DD>
<DT id="28"><A HREF="#lbAC">SYNOPSIS</A><DD>
<DT id="29"><A HREF="#lbAD">DESCRIPTION</A><DD>
<DL>
<DT id="30"><A HREF="#lbAE">The flags argument</A><DD>
<DT id="31"><A HREF="#lbAF">recvfrom()</A><DD>
<DT id="32"><A HREF="#lbAG">recv()</A><DD>
<DT id="33"><A HREF="#lbAH">recvmsg()</A><DD>
</DL>
<DT id="34"><A HREF="#lbAI">RETURN VALUE</A><DD>
<DT id="35"><A HREF="#lbAJ">ERRORS</A><DD>
<DT id="36"><A HREF="#lbAK">CONFORMING TO</A><DD>
<DT id="37"><A HREF="#lbAL">NOTES</A><DD>
<DT id="38"><A HREF="#lbAM">EXAMPLE</A><DD>
<DT id="39"><A HREF="#lbAN">SEE ALSO</A><DD>
<DT id="40"><A HREF="#lbAO">COLOPHON</A><DD>
</DL>
<HR>
This document was created by
<A HREF="/cgi-bin/man/man2html">man2html</A>,
using the manual pages.<BR>
Time: 00:05:34 GMT, March 31, 2021
</BODY>
</HTML>