aports/main/libc0.9.32/eventfd.patch
Natanael Copa 3161576d06 main/libc0.9.32: fix eventfd syscall
<tteras> old kernels have only eventfd()
<tteras> they noticed uh oh, we need add a new parameter
<tteras> so there's eventfd2() syscall
<tteras> when it was added to glibc
<tteras> eventfd2 was already there
<tteras> so the glibc call got name eventfd() even though it had signature of syscall eventfd2()
<ncopa> so they picked eventfd()
<tteras> yeah
<ncopa> doh

Requires 2.6.27+ kernel. The old eventfd() syscall, is not really usable
and emulation is not feasible.
2012-04-27 11:47:25 +00:00

15 lines
404 B
Diff

diff --git a/libc/sysdeps/linux/common/eventfd.c b/libc/sysdeps/linux/common/eventfd.c
index cc3f3f0..06a26ee 100644
--- a/libc/sysdeps/linux/common/eventfd.c
+++ b/libc/sysdeps/linux/common/eventfd.c
@@ -14,5 +14,9 @@
* eventfd()
*/
#ifdef __NR_eventfd
+#ifdef __NR_eventfd2
+#undef __NR_eventfd
+#define __NR_eventfd __NR_eventfd2
+#endif
_syscall2(int, eventfd, int, count, int, flags)
#endif