diff options
Diffstat (limited to 'man2/recvmmsg.2')
-rw-r--r-- | man2/recvmmsg.2 | 34 |
1 files changed, 17 insertions, 17 deletions
diff --git a/man2/recvmmsg.2 b/man2/recvmmsg.2 index d5b0f5a..f732d03 100644 --- a/man2/recvmmsg.2 +++ b/man2/recvmmsg.2 @@ -8,7 +8,7 @@ .\" Author: Arnaldo Carvalho de Melo <acme@redhat.com> .\" Date: Mon Oct 12 23:40:10 2009 -0700 .\" -.TH recvmmsg 2 2023-05-03 "Linux man-pages 6.05.01" +.TH recvmmsg 2 2023-10-31 "Linux man-pages 6.7" .SH NAME recvmmsg \- receive multiple messages on a socket .SH LIBRARY @@ -18,7 +18,7 @@ Standard C library .nf .BR "#define _GNU_SOURCE" " /* See feature_test_macros(7) */" .B #include <sys/socket.h> -.PP +.P .BI "int recvmmsg(int " sockfd ", struct mmsghdr *" msgvec \ ", unsigned int " vlen "," .BI " int " flags ", struct timespec *" timeout ");" @@ -34,11 +34,11 @@ using a single system call. A further extension over .BR recvmsg (2) is support for a timeout on the receive operation. -.PP +.P The .I sockfd argument is the file descriptor of the socket to receive data from. -.PP +.P The .I msgvec argument is a pointer to an array of @@ -46,13 +46,13 @@ argument is a pointer to an array of structures. The size of this array is specified in .IR vlen . -.PP +.P The .I mmsghdr structure is defined in .I <sys/socket.h> as: -.PP +.P .in +4n .EX struct mmsghdr { @@ -61,7 +61,7 @@ struct mmsghdr { }; .EE .in -.PP +.P The .I msg_hdr field is a @@ -74,7 +74,7 @@ field is the number of bytes returned for the message in the entry. This field has the same value as the return value of a single .BR recvmsg (2) on the header. -.PP +.P The .I flags argument contains flags ORed together. @@ -86,7 +86,7 @@ with the following addition: Turns on .B MSG_DONTWAIT after the first message has been received. -.PP +.P The .I timeout argument points to a @@ -101,7 +101,7 @@ may overrun by a small amount.) If .I timeout is NULL, then the operation blocks indefinitely. -.PP +.P A blocking .BR recvmmsg () call blocks until @@ -112,7 +112,7 @@ A nonblocking call reads as many messages as are available (up to the limit specified by .IR vlen ) and returns immediately. -.PP +.P On return from .BR recvmmsg (), successive elements of @@ -143,7 +143,7 @@ In addition, the following error can occur: .B EINVAL .I timeout is invalid. -.PP +.P See also BUGS. .SH STANDARDS Linux. @@ -161,7 +161,7 @@ so that if up to .I vlen\-1 datagrams are received before the timeout expires, but then no further datagrams are received, the call will block forever. -.PP +.P If an error occurs after at least one message has been received, the call succeeds, and returns the number of messages received. The error code is expected to be returned on a subsequent call to @@ -176,20 +176,20 @@ to receive multiple messages on a socket and stores them in multiple buffers. The call returns if all buffers are filled or if the timeout specified has expired. -.PP +.P The following snippet periodically generates UDP datagrams containing a random number: -.PP +.P .in +4n .EX .RB "$" " while true; do echo $RANDOM > /dev/udp/127.0.0.1/1234;" .B " sleep 0.25; done" .EE .in -.PP +.P These datagrams are read by the example application, which can give the following output: -.PP +.P .in +4n .EX .RB "$" " ./a.out" |