strace/tests/epoll_wait.c
Dmitry V. Levin 9f6611bb31 tests: use errno2name()
Automatically change tests/*.c files using the following sed regexp:
sed -i 's/errno == E[[:alnum:]]\+ ? "E[[:alnum:]]\+" : "E[[:alnum:]]\+"/errno2name()/g'
2016-04-21 18:16:50 +00:00

29 lines
518 B
C

#include "tests.h"
#include <sys/syscall.h>
#if defined __NR_epoll_wait && defined HAVE_SYS_EPOLL_H
# include <errno.h>
# include <stdio.h>
# include <sys/epoll.h>
# include <unistd.h>
int
main(void)
{
struct epoll_event *const ev = tail_alloc(sizeof(*ev));
int rc = syscall(__NR_epoll_wait, -1, ev, 1, -2);
printf("epoll_wait(-1, %p, 1, -2) = %d %s (%m)\n",
ev, rc, errno2name());
puts("+++ exited with 0 +++");
return 0;
}
#else
SKIP_MAIN_UNDEFINED("__NR_epoll_wait && HAVE_SYS_EPOLL_H")
#endif