SENDMMSG(2) Linux Programmer's Manual SENDMMSG(2)NAMEsendmmsg - send multiple messages on a socket
SYNOPSIS
#include <sys/socket.h>
int sendmmsg(int fd, struct mmsghdr *mmsghdr, unsigned int vlen,
unsigned int flags);
DESCRIPTION
The sendmmsg system call transmits multiple messages to another socket.
It acts similar to sendmsg(2), but allows to batch multiple receive
operations into a single syscall.
fd is the file descriptor of the socket data is transmitted through.
mmsghdr is a pointer to an array with length vlen of mmsghdr struc‐
tures. struct mmsg is defined in sys/socket.h as:
struct mmsghdr {
struct msghdr msg_hdr; /* Message header */
unsigned int msg_len;
};
msg_hdr is a struct msghdr as described in sendmsg(2). msg_len is the
number of bytes send for the message in the entry. This field has the
same value as the return value of a single sendmsg(2) on the header.
flags contains flags ored together. The flags are the same as docu‐
mented for sendmsg(2).
RETURN VALUEsendmmsg returns the number of messages sent in mmsghdr or -1 when an
error occurs. The msg_len members of mmsghdr are updated for each sent
message, in addition to other fields in the msg_hdr for each message,
as described in sendmsg(2).
SEE ALSOrecvmsg(2), recvmmsg(2), sendmsg(2), socket(7), socket(2), clock_get‐
time(2)VERSIONS
The sendmmsg syscall was added with kernel 3.0. On earlier glibcs the
function can be called manually using syscall(2).
Linux 2010-11-23 SENDMMSG(2)