Fei Jie | c75e2c2 | 2016-04-08 15:59:16 +0800 | [diff] [blame] | 1 | #include "tests.h" |
| 2 | #include <sys/syscall.h> |
| 3 | |
| 4 | #if defined __NR_epoll_wait && defined HAVE_SYS_EPOLL_H |
| 5 | |
| 6 | # include <errno.h> |
| 7 | # include <stdio.h> |
| 8 | # include <sys/epoll.h> |
| 9 | # include <unistd.h> |
| 10 | |
| 11 | int |
| 12 | main(void) |
| 13 | { |
| 14 | struct epoll_event *const ev = tail_alloc(sizeof(*ev)); |
| 15 | |
Dmitry V. Levin | 33568cf | 2016-04-21 20:38:15 +0000 | [diff] [blame^] | 16 | long rc = syscall(__NR_epoll_wait, -1, ev, 1, -2); |
| 17 | printf("epoll_wait(-1, %p, 1, -2) = %ld %s (%m)\n", |
Dmitry V. Levin | 9f6611b | 2016-04-21 17:49:32 +0000 | [diff] [blame] | 18 | ev, rc, errno2name()); |
Fei Jie | c75e2c2 | 2016-04-08 15:59:16 +0800 | [diff] [blame] | 19 | |
| 20 | puts("+++ exited with 0 +++"); |
| 21 | return 0; |
| 22 | } |
| 23 | |
| 24 | #else |
| 25 | |
| 26 | SKIP_MAIN_UNDEFINED("__NR_epoll_wait && HAVE_SYS_EPOLL_H") |
| 27 | |
| 28 | #endif |