From: Dmitry V. Levin Date: Mon, 9 May 2016 21:46:17 +0000 (+0000) Subject: Assume that sys/epoll.h exists X-Git-Tag: v4.12~207 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=6d44012cb5fdaceed6f00d9526e5906afbcfc8c5;p=strace Assume that sys/epoll.h exists This header file was added in glibc-2.3.2, so it's safe to assume its availability. * configure.ac (AC_CHECK_HEADERS): Remove sys/epoll.h. * epoll.c: Include unconditionally. Compile [HAVE_SYS_EPOLL_H] code unconditionally. * tests/epoll_ctl.c: Do not check for HAVE_SYS_EPOLL_H. * tests/epoll_wait.c: Likewise. --- diff --git a/configure.ac b/configure.ac index 8a776d2e..dbe52e45 100644 --- a/configure.ac +++ b/configure.ac @@ -381,7 +381,6 @@ AC_CHECK_HEADERS(m4_normalize([ scsi/sg.h stropts.h sys/conf.h - sys/epoll.h sys/eventfd.h sys/fanotify.h sys/ioctl.h diff --git a/epoll.c b/epoll.c index 30e5098e..20d306c4 100644 --- a/epoll.c +++ b/epoll.c @@ -29,9 +29,7 @@ #include "defs.h" #include -#ifdef HAVE_SYS_EPOLL_H -# include -#endif +#include SYS_FUNC(epoll_create) { @@ -49,8 +47,7 @@ SYS_FUNC(epoll_create1) return RVAL_DECODED | RVAL_FD; } -#ifdef HAVE_SYS_EPOLL_H -# include "xlat/epollevents.h" +#include "xlat/epollevents.h" static bool print_epoll_event(struct tcb *tcp, void *elem_buf, size_t elem_size, void *data) @@ -66,7 +63,6 @@ print_epoll_event(struct tcb *tcp, void *elem_buf, size_t elem_size, void *data) return true; } -#endif #include "xlat/epollctls.h" @@ -78,15 +74,11 @@ SYS_FUNC(epoll_ctl) tprints(", "); printfd(tcp, tcp->u_arg[2]); tprints(", "); -#ifdef HAVE_SYS_EPOLL_H struct epoll_event ev; if (EPOLL_CTL_DEL == tcp->u_arg[1]) printaddr(tcp->u_arg[3]); else if (!umove_or_printaddr(tcp, tcp->u_arg[3], &ev)) print_epoll_event(tcp, &ev, sizeof(ev), 0); -#else - printaddr(tcp->u_arg[3]); -#endif return RVAL_DECODED; } @@ -98,13 +90,9 @@ epoll_wait_common(struct tcb *tcp) printfd(tcp, tcp->u_arg[0]); tprints(", "); } else { -#ifdef HAVE_SYS_EPOLL_H struct epoll_event ev; print_array(tcp, tcp->u_arg[1], tcp->u_rval, &ev, sizeof(ev), umoven_or_printaddr, print_epoll_event, 0); -#else - printaddr(tcp->u_arg[1]); -#endif tprintf(", %d, %d", (int) tcp->u_arg[2], (int) tcp->u_arg[3]); } } diff --git a/tests/epoll_ctl.c b/tests/epoll_ctl.c index ffb12ac5..ffabca17 100644 --- a/tests/epoll_ctl.c +++ b/tests/epoll_ctl.c @@ -1,7 +1,7 @@ #include "tests.h" #include -#if defined __NR_epoll_ctl && defined HAVE_SYS_EPOLL_H +#ifdef __NR_epoll_ctl # include # include @@ -33,6 +33,6 @@ main(void) #else -SKIP_MAIN_UNDEFINED("__NR_epoll_ctl && HAVE_SYS_EPOLL_H") +SKIP_MAIN_UNDEFINED("__NR_epoll_ctl") #endif diff --git a/tests/epoll_wait.c b/tests/epoll_wait.c index df1d3c2e..c2eb563b 100644 --- a/tests/epoll_wait.c +++ b/tests/epoll_wait.c @@ -1,7 +1,7 @@ #include "tests.h" #include -#if defined __NR_epoll_wait && defined HAVE_SYS_EPOLL_H +#ifdef __NR_epoll_wait # include # include @@ -22,6 +22,6 @@ main(void) #else -SKIP_MAIN_UNDEFINED("__NR_epoll_wait && HAVE_SYS_EPOLL_H") +SKIP_MAIN_UNDEFINED("__NR_epoll_wait") #endif