1 From 7810e4f8027b5c4c8ceec6fefec4eb779362ebb5 Mon Sep 17 00:00:00 2001
2 From: Khem Raj <raj.khem@gmail.com>
3 Date: Sun, 10 Jun 2012 16:36:23 +0000
4 Subject: eventfd: Implement eventfd2 and fix eventfd
6 eventfd: evntfd assumes to take two arguments instead it
7 should be one evntfd expects two therefore implement both syscalls with
10 Thanks Eugene Rudoy for reporting it and also providing the patch
12 Signed-off-by: Khem Raj <raj.khem@gmail.com>
14 --- a/libc/sysdeps/linux/common/eventfd.c
15 +++ b/libc/sysdeps/linux/common/eventfd.c
17 * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
21 #include <sys/syscall.h>
22 #include <sys/eventfd.h>
28 -_syscall2(int, eventfd, int, count, int, flags)
29 +#if defined __NR_eventfd || defined __NR_eventfd2
30 +int eventfd (int count, int flags)
32 +#if defined __NR_eventfd2
33 + return INLINE_SYSCALL (eventfd2, 2, count, flags);
34 +#elif defined __NR_eventfd
36 + __set_errno (EINVAL);
39 + return INLINE_SYSCALL (eventfd, 1, count);
43 --- a/libc/sysdeps/linux/common/stubs.c
44 +++ b/libc/sysdeps/linux/common/stubs.c
45 @@ -93,7 +93,7 @@ make_stub(epoll_ctl)
49 -#if !defined __NR_eventfd && defined __UCLIBC_LINUX_SPECIFIC__
50 +#if !defined __NR_eventfd && !defined __NR_eventfd2 && defined __UCLIBC_LINUX_SPECIFIC__