[PATCH 17/46] epoll: Use epoll_create1 if arch does not have the epoll_create syscall
Markos Chandras
markos.chandras at gmail.com
Tue Nov 13 11:31:26 UTC 2012
From: Markos Chandras <markos.chandras at imgtec.com>
Signed-off-by: Markos Chandras <markos.chandras at imgtec.com>
---
libc/sysdeps/linux/common/epoll.c | 20 ++++++++++++++------
1 files changed, 14 insertions(+), 6 deletions(-)
diff --git a/libc/sysdeps/linux/common/epoll.c b/libc/sysdeps/linux/common/epoll.c
index ab3e73b..36cda92 100644
--- a/libc/sysdeps/linux/common/epoll.c
+++ b/libc/sysdeps/linux/common/epoll.c
@@ -16,17 +16,25 @@
#endif
/*
- * epoll_create()
+ * epoll_create1()
*/
-#ifdef __NR_epoll_create
-_syscall1(int, epoll_create, int, size)
+#if defined(__NR_epoll_create1)
+_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);
+}
+
/*
- * epoll_create1()
+ * epoll_create()
*/
-#ifdef __NR_epoll_create1
-_syscall1(int, epoll_create1, int, flags)
+
+/* For systems that have both, prefer the old one */
+#else
+_syscall1(int, epoll_create, int, size)
#endif
/*
--
1.7.1
More information about the uClibc
mailing list