tests: fix build on systems that lack O_CLOEXEC definition

* tests/epoll_create1.c (main): Check that O_CLOEXEC is defined.
* tests/eventfd.c (main): Likewise.
* tests/signalfd.c (main): Likewise.
This commit is contained in:
Дмитрий Левин 2015-08-26 21:02:04 +00:00
parent ff6b6f3f72
commit 857adac3a5
3 changed files with 3 additions and 3 deletions

View File

@ -9,7 +9,7 @@
int
main(void)
{
#ifdef __NR_epoll_create1
#if defined __NR_epoll_create1 && defined O_CLOEXEC
(void) close(0);
if (syscall(__NR_epoll_create1, O_CLOEXEC))
return 77;

View File

@ -9,7 +9,7 @@
int
main(void)
{
#ifdef __NR_eventfd2
#if defined __NR_eventfd2 && defined O_CLOEXEC
(void) close(0);
return syscall(__NR_eventfd2, -1L, 1 | O_CLOEXEC | O_NONBLOCK) == 0 ?
0 : 77;

View File

@ -12,7 +12,7 @@
int
main(void)
{
#if defined HAVE_SYS_SIGNALFD_H && defined HAVE_SIGNALFD
#if defined HAVE_SYS_SIGNALFD_H && defined HAVE_SIGNALFD && defined O_CLOEXEC
sigset_t mask;
sigemptyset(&mask);
sigaddset(&mask, SIGUSR2);