Dmitry V. Levin | bf62c1b | 2015-08-01 23:04:32 +0000 | [diff] [blame] | 1 | #ifdef HAVE_CONFIG_H |
| 2 | # include "config.h" |
| 3 | #endif |
| 4 | |
| 5 | #include <fcntl.h> |
| 6 | #include <unistd.h> |
| 7 | #include <sys/syscall.h> |
| 8 | |
| 9 | int |
| 10 | main(void) |
| 11 | { |
Dmitry V. Levin | 857adac | 2015-08-26 21:02:04 +0000 | [diff] [blame] | 12 | #if defined __NR_epoll_create1 && defined O_CLOEXEC |
Dmitry V. Levin | bf62c1b | 2015-08-01 23:04:32 +0000 | [diff] [blame] | 13 | (void) close(0); |
| 14 | if (syscall(__NR_epoll_create1, O_CLOEXEC)) |
| 15 | return 77; |
| 16 | return syscall(__NR_epoll_create1, O_CLOEXEC | O_NONBLOCK) >= 0; |
| 17 | #else |
| 18 | return 77; |
| 19 | #endif |
| 20 | } |