[PATCH v3 19/48] epoll: Use epoll_create1 if arch does not have the epoll_create syscall
Markos Chandras
markos.chandras at gmail.com
Wed Jan 23 11:41:43 UTC 2013
From: Markos Chandras <markos.chandras at imgtec.com>
Signed-off-by: Markos Chandras <markos.chandras at imgtec.com>
---
libc/sysdeps/linux/common/epoll.c | 8 ++++++++
libc/sysdeps/linux/common/stubs.c | 3 ++-
2 files changed, 10 insertions(+), 1 deletion(-)
diff --git a/libc/sysdeps/linux/common/epoll.c b/libc/sysdeps/linux/common/epoll.c
index 29b4600..88b3021 100644
--- a/libc/sysdeps/linux/common/epoll.c
+++ b/libc/sysdeps/linux/common/epoll.c
@@ -19,6 +19,14 @@ _syscall1(int, epoll_create, int, size)
_syscall1(int, epoll_create1, int, flags)
#endif
+#if defined(__NR_epoll_create1) && !defined(__NR_epoll_create)
+int epoll_create(int size)
+{
+ return INLINE_SYSCALL(epoll_create1, 1, 0);
+}
+
+#endif
+
#ifdef __NR_epoll_ctl
_syscall4(int, epoll_ctl, int, epfd, int, op, int, fd, struct epoll_event *, event)
#endif
diff --git a/libc/sysdeps/linux/common/stubs.c b/libc/sysdeps/linux/common/stubs.c
index c19ce8f..63ee293 100644
--- a/libc/sysdeps/linux/common/stubs.c
+++ b/libc/sysdeps/linux/common/stubs.c
@@ -94,7 +94,8 @@ make_stub(create_module)
make_stub(delete_module)
#endif
-#if !defined __NR_epoll_create && defined __UCLIBC_HAS_EPOLL__
+#if !defined __NR_epoll_create && defined __UCLIBC_HAS_EPOLL__ \
+ && !defined(__NR_epoll_create1)
make_stub(epoll_create)
#endif
--
1.8.1.1
More information about the uClibc
mailing list