]> granicus.if.org Git - strace/commitdiff
Assume that sys/epoll.h exists
authorDmitry V. Levin <ldv@altlinux.org>
Mon, 9 May 2016 21:46:17 +0000 (21:46 +0000)
committerDmitry V. Levin <ldv@altlinux.org>
Mon, 9 May 2016 21:46:17 +0000 (21:46 +0000)
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 <sys/epoll.h> 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.

configure.ac
epoll.c
tests/epoll_ctl.c
tests/epoll_wait.c

index 8a776d2e4b321823a079bc3dcf4dd401f13f30ed..dbe52e451290f8bb9e01268fa61a9608a103656a 100644 (file)
@@ -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 30e5098e40d553a93bd61f86d346d387541953cb..20d306c4ef4001737687367664547de639384c39 100644 (file)
--- a/epoll.c
+++ b/epoll.c
@@ -29,9 +29,7 @@
 
 #include "defs.h"
 #include <fcntl.h>
-#ifdef HAVE_SYS_EPOLL_H
-# include <sys/epoll.h>
-#endif
+#include <sys/epoll.h>
 
 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]);
        }
 }
index ffb12ac53850f26752fcdf95f4b2631e124dbb43..ffabca173fc8b66b3441828eb28e3365872b84b0 100644 (file)
@@ -1,7 +1,7 @@
 #include "tests.h"
 #include <sys/syscall.h>
 
-#if defined __NR_epoll_ctl && defined HAVE_SYS_EPOLL_H
+#ifdef __NR_epoll_ctl
 
 # include <inttypes.h>
 # include <stdio.h>
@@ -33,6 +33,6 @@ main(void)
 
 #else
 
-SKIP_MAIN_UNDEFINED("__NR_epoll_ctl && HAVE_SYS_EPOLL_H")
+SKIP_MAIN_UNDEFINED("__NR_epoll_ctl")
 
 #endif
index df1d3c2e5b2460a31185c184c2ade735b105d629..c2eb563bb86d1882255040034c220830dc0c2276 100644 (file)
@@ -1,7 +1,7 @@
 #include "tests.h"
 #include <sys/syscall.h>
 
-#if defined __NR_epoll_wait && defined HAVE_SYS_EPOLL_H
+#ifdef __NR_epoll_wait
 
 # include <stdio.h>
 # include <sys/epoll.h>
@@ -22,6 +22,6 @@ main(void)
 
 #else
 
-SKIP_MAIN_UNDEFINED("__NR_epoll_wait && HAVE_SYS_EPOLL_H")
+SKIP_MAIN_UNDEFINED("__NR_epoll_wait")
 
 #endif