summaryrefslogtreecommitdiffstats
path: root/meta/recipes-core/uclibc/uclibc-git/0001-Add-eventfd_read-and-eventfd_write.patch
diff options
context:
space:
mode:
Diffstat (limited to 'meta/recipes-core/uclibc/uclibc-git/0001-Add-eventfd_read-and-eventfd_write.patch')
-rw-r--r--meta/recipes-core/uclibc/uclibc-git/0001-Add-eventfd_read-and-eventfd_write.patch120
1 files changed, 120 insertions, 0 deletions
diff --git a/meta/recipes-core/uclibc/uclibc-git/0001-Add-eventfd_read-and-eventfd_write.patch b/meta/recipes-core/uclibc/uclibc-git/0001-Add-eventfd_read-and-eventfd_write.patch
new file mode 100644
index 0000000..dd0efc0
--- /dev/null
+++ b/meta/recipes-core/uclibc/uclibc-git/0001-Add-eventfd_read-and-eventfd_write.patch
@@ -0,0 +1,120 @@
1From e3aae24ede969e2dede1aa19c2ee520cab71ce11 Mon Sep 17 00:00:00 2001
2From: Khem Raj <raj.khem@gmail.com>
3Date: Thu, 20 Feb 2014 00:30:18 -0800
4Subject: [PATCH 1/3] Add eventfd_read() and eventfd_write()
5
6Signed-off-by: Khem Raj <raj.khem@gmail.com>
7Upstream-Status: Pending
8---
9 libc/sysdeps/linux/common/Makefile.in | 2 ++
10 libc/sysdeps/linux/common/eventfd_read.c | 27 +++++++++++++++++++++++++++
11 libc/sysdeps/linux/common/eventfd_write.c | 28 ++++++++++++++++++++++++++++
12 libc/sysdeps/linux/common/sys/eventfd.h | 4 ----
13 4 files changed, 57 insertions(+), 4 deletions(-)
14 create mode 100644 libc/sysdeps/linux/common/eventfd_read.c
15 create mode 100644 libc/sysdeps/linux/common/eventfd_write.c
16
17diff --git a/libc/sysdeps/linux/common/Makefile.in b/libc/sysdeps/linux/common/Makefile.in
18index dbf0b0f..45d2e21 100644
19--- a/libc/sysdeps/linux/common/Makefile.in
20+++ b/libc/sysdeps/linux/common/Makefile.in
21@@ -25,6 +25,8 @@ CSRC-$(UCLIBC_LINUX_SPECIFIC) += \
22 capset.c \
23 dup3.c \
24 eventfd.c \
25+ eventfd_read.c \
26+ eventfd_write.c \
27 inotify.c \
28 ioperm.c \
29 iopl.c \
30diff --git a/libc/sysdeps/linux/common/eventfd_read.c b/libc/sysdeps/linux/common/eventfd_read.c
31new file mode 100644
32index 0000000..75f2aaa
33--- /dev/null
34+++ b/libc/sysdeps/linux/common/eventfd_read.c
35@@ -0,0 +1,27 @@
36+/* Copyright (C) 2007-2014 Free Software Foundation, Inc.
37+ This file is part of the GNU C Library.
38+
39+ The GNU C Library is free software; you can redistribute it and/or
40+ modify it under the terms of the GNU Lesser General Public
41+ License as published by the Free Software Foundation; either
42+ version 2.1 of the License, or (at your option) any later version.
43+
44+ The GNU C Library is distributed in the hope that it will be useful,
45+ but WITHOUT ANY WARRANTY; without even the implied warranty of
46+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
47+ Lesser General Public License for more details.
48+
49+ You should have received a copy of the GNU Lesser General Public
50+ License along with the GNU C Library; if not, see
51+ <http://www.gnu.org/licenses/>. */
52+
53+#include <errno.h>
54+#include <unistd.h>
55+#include <sys/eventfd.h>
56+
57+
58+int
59+eventfd_read (int fd, eventfd_t *value)
60+{
61+ return read (fd, value, sizeof (eventfd_t)) != sizeof (eventfd_t) ? -1 : 0;
62+}
63diff --git a/libc/sysdeps/linux/common/eventfd_write.c b/libc/sysdeps/linux/common/eventfd_write.c
64new file mode 100644
65index 0000000..e1509cf
66--- /dev/null
67+++ b/libc/sysdeps/linux/common/eventfd_write.c
68@@ -0,0 +1,28 @@
69+/* Copyright (C) 2007-2014 Free Software Foundation, Inc.
70+ This file is part of the GNU C Library.
71+
72+ The GNU C Library is free software; you can redistribute it and/or
73+ modify it under the terms of the GNU Lesser General Public
74+ License as published by the Free Software Foundation; either
75+ version 2.1 of the License, or (at your option) any later version.
76+
77+ The GNU C Library is distributed in the hope that it will be useful,
78+ but WITHOUT ANY WARRANTY; without even the implied warranty of
79+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
80+ Lesser General Public License for more details.
81+
82+ You should have received a copy of the GNU Lesser General Public
83+ License along with the GNU C Library; if not, see
84+ <http://www.gnu.org/licenses/>. */
85+
86+#include <errno.h>
87+#include <unistd.h>
88+#include <sys/eventfd.h>
89+
90+
91+int
92+eventfd_write (int fd, eventfd_t value)
93+{
94+ return write (fd, &value,
95+ sizeof (eventfd_t)) != sizeof (eventfd_t) ? -1 : 0;
96+}
97diff --git a/libc/sysdeps/linux/common/sys/eventfd.h b/libc/sysdeps/linux/common/sys/eventfd.h
98index 1bf785f..91b265b 100644
99--- a/libc/sysdeps/linux/common/sys/eventfd.h
100+++ b/libc/sysdeps/linux/common/sys/eventfd.h
101@@ -33,16 +33,12 @@ __BEGIN_DECLS
102 value to COUNT. */
103 extern int eventfd (int __count, int __flags) __THROW;
104
105-#if 0 /* not (yet) implemented in uClibc */
106-
107 /* Read event counter and possibly wait for events. */
108 extern int eventfd_read (int __fd, eventfd_t *__value);
109
110 /* Increment event counter. */
111 extern int eventfd_write (int __fd, eventfd_t __value);
112
113-#endif
114-
115 __END_DECLS
116
117 #endif /* sys/eventfd.h */
118--
1191.9.0
120