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 <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.
This commit is contained in:
Дмитрий Левин 2016-05-09 21:46:17 +00:00
parent 071b9274f4
commit 6d44012cb5
4 changed files with 6 additions and 19 deletions

View 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

16
epoll.c
View File

@ -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]);
}
}

View 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

View 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