check_include_file(sys/signalfd.h HAVE_SYS_SIGNALFD_H)
check_include_file(sys/eventfd.h HAVE_SYS_EVENTFD_H)
check_include_file(sys/timerfd.h HAVE_SYS_TIMERFD_H)
+check_include_file(sys/syscall.h HAVE_SYS_SYSCALL_H)
check_include_file(gnu/lib-names.h HAVE_GNU_LIB_NAMES_H)
check_include_file(rpc/rpc.h HAVE_RPC_RPC_H)
+check_include_file(syscall.h HAVE_SYSCALL_H)
# SYMBOLS
set(CMAKE_REQUIRED_FLAGS -D_GNU_SOURCE)
check_function_exists(bindresvport HAVE_BINDRESVPORT)
check_function_exists(accept4 HAVE_ACCEPT4)
check_function_exists(open64 HAVE_OPEN64)
+check_function_exists(openat64 HAVE_OPENAT64)
check_function_exists(fopen64 HAVE_FOPEN64)
check_function_exists(getprogname HAVE_GETPROGNAME)
check_function_exists(getexecname HAVE_GETEXECNAME)
check_function_exists(pledge HAVE_PLEDGE)
check_function_exists(_socket HAVE__SOCKET)
check_function_exists(_close HAVE__CLOSE)
+check_function_exists(__close_nocancel HAVE___CLOSE_NOCANCEL)
+check_function_exists(recvmmsg HAVE_RECVMMSG)
+check_function_exists(sendmmsg HAVE_SENDMMSG)
+check_function_exists(syscall HAVE_SYSCALL)
+check_function_exists(fcntl64 HAVE_FCNTL64)
if (UNIX)
find_library(DLFCN_LIBRARY dl)
HAVE_EVENTFD_UNSIGNED_INT)
endif (HAVE_EVENTFD)
+if (HAVE_SYSCALL)
+ set(CMAKE_REQUIRED_DEFINITIONS -D_GNU_SOURCE)
+
+ check_prototype_definition(syscall
+ "int syscall(int sysno, ...)"
+ "-1"
+ "unistd.h;sys/syscall.h"
+ HAVE_SYSCALL_INT)
+ set(CMAKE_REQUIRED_DEFINITIONS)
+endif (HAVE_SYSCALL)
+
+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)
+
# IPV6
check_c_source_compiles("
#include <stdlib.h>