+if (HAVE_RECVMMSG)
+ # Linux legacy glibc < 2.21
+ set(CMAKE_REQUIRED_DEFINITIONS -D_GNU_SOURCE)
+ check_prototype_definition(recvmmsg
+ "int recvmmsg(int __fd, struct mmsghdr *__vmessages, unsigned int __vlen, int __flags, const struct timespec *__tmo)"
+ "-1"
+ "sys/types.h;sys/socket.h"
+ HAVE_RECVMMSG_CONST_TIMEOUT)
+ set(CMAKE_REQUIRED_DEFINITIONS)
+
+ # FreeBSD
+ check_prototype_definition(recvmmsg
+ "ssize_t recvmmsg(int __fd, struct mmsghdr * __restrict __vmessages, size_t __vlen, int __flags, const struct timespec * __restrict __tmo)"
+ "-1"
+ "sys/types.h;sys/socket.h"
+ HAVE_RECVMMSG_SSIZE_T_CONST_TIMEOUT)
+endif (HAVE_RECVMMSG)
+
+if (HAVE_SENDMMSG)
+ # FreeBSD
+ check_prototype_definition(sendmmsg
+ "ssize_t sendmmsg(int __fd, struct mmsghdr * __restrict __vmessages, size_t __vlen, int __flags)"
+ "-1"
+ "sys/types.h;sys/socket.h"
+ HAVE_SENDMMSG_SSIZE_T)
+endif (HAVE_SENDMMSG)
+