Dmitry V. Levin
96a9ff5746
Automatically change tests/*.c files using the following script: for f in tests/*.c; do grep -Fv errno.h "$f" | grep -Ewq '(si_)?errno|SOCK_FILTER_DENY_SYSCALL' || sed -i '/# *include *<errno\.h>/d' "$f" done
28 lines
500 B
C
28 lines
500 B
C
#include "tests.h"
|
|
#include <sys/syscall.h>
|
|
|
|
#if defined __NR_epoll_wait && defined HAVE_SYS_EPOLL_H
|
|
|
|
# include <stdio.h>
|
|
# include <sys/epoll.h>
|
|
# include <unistd.h>
|
|
|
|
int
|
|
main(void)
|
|
{
|
|
struct epoll_event *const ev = tail_alloc(sizeof(*ev));
|
|
|
|
long rc = syscall(__NR_epoll_wait, -1, ev, 1, -2);
|
|
printf("epoll_wait(-1, %p, 1, -2) = %ld %s (%m)\n",
|
|
ev, rc, errno2name());
|
|
|
|
puts("+++ exited with 0 +++");
|
|
return 0;
|
|
}
|
|
|
|
#else
|
|
|
|
SKIP_MAIN_UNDEFINED("__NR_epoll_wait && HAVE_SYS_EPOLL_H")
|
|
|
|
#endif
|