blob: 4e4c4220c65d08ecafc0be0bf0161600e855d2fc [file] [log] [blame]
Dmitry V. Levinbf62c1b2015-08-01 23:04:32 +00001#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
9int
10main(void)
11{
Dmitry V. Levin857adac2015-08-26 21:02:04 +000012#if defined __NR_epoll_create1 && defined O_CLOEXEC
Dmitry V. Levinbf62c1b2015-08-01 23:04:32 +000013 (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}