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:
parent
ff6b6f3f72
commit
857adac3a5
@ -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;
|
||||
|
@ -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;
|
||||
|
@ -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);
|
||||
|
Loading…
x
Reference in New Issue
Block a user