From c6057584e07fae9c8b96e6a5af0271b2e2bc85f6 Mon Sep 17 00:00:00 2001 From: "Peter S. Mazinger" Date: Fri, 13 May 2011 01:56:08 +0200 Subject: epoll.c: add cancellation to epoll_[p]wait() While there, fix epoll_pwait syscall, it takes 6 arguments Signed-off-by: Peter S. Mazinger Signed-off-by: Bernhard Reutner-Fischer --- libc/sysdeps/linux/common/epoll.c | 25 +++++++++++++++++++++---- 1 file changed, 21 insertions(+), 4 deletions(-) (limited to 'libc/sysdeps/linux/common/epoll.c') diff --git a/libc/sysdeps/linux/common/epoll.c b/libc/sysdeps/linux/common/epoll.c index 41c4eacc2..e3cbb00bf 100644 --- a/libc/sysdeps/linux/common/epoll.c +++ b/libc/sysdeps/linux/common/epoll.c @@ -9,6 +9,7 @@ #include #include +#include /* * epoll_create() @@ -35,14 +36,30 @@ _syscall4(int,epoll_ctl, int, epfd, int, op, int, fd, struct epoll_event *, even * epoll_wait() */ #ifdef __NR_epoll_wait -_syscall4(int, epoll_wait, int, epfd, struct epoll_event *, events, int, maxevents, int, timeout) -/* TODO: add cancellation for epoll_wait */ +static int __NC(epoll_wait)(int epfd, struct epoll_event *events, int maxevents, int timeout) +{ + return INLINE_SYSCALL(epoll_wait, 4, epfd, events, maxevents, timeout); +} +CANCELLABLE_SYSCALL(int, epoll_wait, (int epfd, struct epoll_event *events, int maxevents, int timeout), + (epfd, events, maxevents, timeout)) #endif /* * epoll_pwait() */ #ifdef __NR_epoll_pwait -_syscall5(int, epoll_pwait, int, epfd, struct epoll_event *, events, int, maxevents, int, timeout, __const sigset_t *, ss) -/* TODO: add cancellation for epoll_pwait */ +# include + +# define __NR___syscall_epoll_pwait __NR_epoll_pwait +static __always_inline _syscall6(int, __syscall_epoll_pwait, int, epfd, struct epoll_event *, events, + int, maxevents, int, timeout, const sigset_t *, sigmask, size_t, sigsetsize) + +static int __NC(epoll_pwait)(int epfd, struct epoll_event *events, int maxevents, int timeout, + const sigset_t *set) +{ + return __syscall_epoll_pwait(epfd, events, maxevents, timeout, set, __SYSCALL_SIGSET_T_SIZE); +} +CANCELLABLE_SYSCALL(int, epoll_pwait, (int epfd, struct epoll_event *events, int maxevents, int timeout, + const sigset_t *set), + (epfd, events, maxevents, timeout, set)) #endif -- cgit v1.2.3