strace/tests/epoll_create1.c
Dmitry V. Levin bf62c1b52d epoll_create1: fix flags decoding
* xlat/epollflags.in: Remove EPOLL_NONBLOCK, provide fallback definition
for EPOLL_CLOEXEC.
* tests/epoll_create1.c: New file.
* tests/epoll_create1.expected: Likewise.
* tests/epoll_create1.test: New test.
* tests/Makefile.am (check_PROGRAMS): Add epoll_create1.
(TESTS): Add epoll_create1.test.
(EXTRA_DIST): Add epoll_create1.expected.
* tests/.gitignore: Add epoll_create1.
2015-08-02 00:10:48 +00:00

21 lines
334 B
C

#ifdef HAVE_CONFIG_H
# include "config.h"
#endif
#include <fcntl.h>
#include <unistd.h>
#include <sys/syscall.h>
int
main(void)
{
#ifdef __NR_epoll_create1
(void) close(0);
if (syscall(__NR_epoll_create1, O_CLOEXEC))
return 77;
return syscall(__NR_epoll_create1, O_CLOEXEC | O_NONBLOCK) >= 0;
#else
return 77;
#endif
}