table of contents
other versions
- wheezy 3.44-1
- jessie 3.74-1
- jessie-backports 4.10-2~bpo8+1
- testing 4.10-2
- unstable 4.10-2
RECVMMSG(2) | Linux Programmer's Manual | RECVMMSG(2) |
NAME¶
recvmmsg - receive multiple messages on a socketSYNOPSIS¶
#define _GNU_SOURCE #include <sys/socket.h> int recvmmsg(int sockfd, struct mmsghdr *msgvec, unsigned int vlen,unsigned int flags, struct timespec *timeout);
DESCRIPTION¶
The recvmmsg() system call is an extension of recvmsg(2) that allows the caller to receive multiple messages from a socket using a single system call. (This has performance benefits for some applications.) A further extension over recvmsg(2) is support for a timeout on the receive operation.struct mmsghdr { struct msghdr msg_hdr; /* Message header */ unsigned int msg_len; /* Number of received bytes for header */ };
The msg_hdr field is a msghdr structure, as described in recvmsg(2). The msg_len 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 recvmsg(2) on the header.
- MSG_WAITFORONE
- Turns on MSG_DONTWAIT after the first message has been received.
RETURN VALUE¶
On success, recvmmsg() returns the number of messages received in msgvec; on error, -1 is returned, and errno is set to indicate the error.ERRORS¶
Errors are as for recvmsg(2). In addition, the following error can occur:- EINVAL
- timeout is invalid.
VERSIONS¶
The recvmmsg() system call was added in Linux 2.6.32. Support in glibc was added in version 2.12.CONFORMING TO¶
recvmmsg() is Linux-specific.SEE ALSO¶
clock_gettime(2), recvmsg(2), sendmmsg(2), sendmsg(2), socket(2), socket(7)COLOPHON¶
This page is part of release 3.44 of the Linux man-pages project. A description of the project, and information about reporting bugs, can be found at http://www.kernel.org/doc/man-pages/.2012-05-02 | Linux |