From: Markos Chandras <markos.chand...@imgtec.com>

Signed-off-by: Markos Chandras <markos.chand...@imgtec.com>
---
 libc/sysdeps/linux/common/epoll.c | 10 ++++++++++
 libc/sysdeps/linux/common/stubs.c |  3 ++-
 2 files changed, 12 insertions(+), 1 deletion(-)

diff --git a/libc/sysdeps/linux/common/epoll.c 
b/libc/sysdeps/linux/common/epoll.c
index 88b3021..82ef7c4 100644
--- a/libc/sysdeps/linux/common/epoll.c
+++ b/libc/sysdeps/linux/common/epoll.c
@@ -55,4 +55,14 @@ static int __NC(epoll_pwait)(int epfd, struct epoll_event 
*events, int maxevents
 CANCELLABLE_SYSCALL(int, epoll_pwait, (int epfd, struct epoll_event *events, 
int maxevents, int timeout,
                                       const sigset_t *set),
                    (epfd, events, maxevents, timeout, set))
+/*
+ * If epoll_wait is not defined, then call epoll_pwait instead using NULL
+ * for sigmask argument
+ */
+#if !defined(__NR_epoll_wait)
+int epoll_wait(int epfd, struct epoll_event *events, int maxevents, int 
timeout)
+{
+       return INLINE_SYSCALL(epoll_pwait, 5, epfd, events, maxevents, timeout, 
NULL);
+}
+#endif
 #endif
diff --git a/libc/sysdeps/linux/common/stubs.c 
b/libc/sysdeps/linux/common/stubs.c
index 63ee293..2faf6ec 100644
--- a/libc/sysdeps/linux/common/stubs.c
+++ b/libc/sysdeps/linux/common/stubs.c
@@ -107,7 +107,8 @@ make_stub(epoll_ctl)
 make_stub(epoll_pwait)
 #endif
 
-#if !defined __NR_epoll_wait && defined __UCLIBC_HAS_EPOLL__
+#if !defined __NR_epoll_wait && defined __UCLIBC_HAS_EPOLL__ \
+               && !defined(__NR_epoll_pwait)
 make_stub(epoll_wait)
 #endif
 
-- 
1.8.1.1


_______________________________________________
uClibc mailing list
uClibc@uclibc.org
http://lists.busybox.net/mailman/listinfo/uclibc

Reply via email to