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