#define _GNU_SOURCE #include #include #include #include "syscall.h" int sendmmsg(int fd, struct mmsghdr *msgvec, unsigned int vlen, unsigned int flags) { #if LONG_MAX > INT_MAX /* Can't use the syscall directly because the kernel has the wrong * idea for the types of msg_iovlen, msg_controllen, and cmsg_len, * and the cmsg blocks cannot be modified in-place. */ int i; if (vlen > IOV_MAX) vlen = IOV_MAX; /* This matches the kernel. */ if (!vlen) return 0; for (i=0; i