1 From fd355bc1dbcb794ae1abf0fad1459e28d8567ba0 Mon Sep 17 00:00:00 2001
2 From: Hiroaki KAWAI <kawai@stratosphere.co.jp>
3 Date: Fri, 19 Apr 2013 01:09:35 +0000
4 Subject: eventfd.h: Use new "bits/" scheme for arch-specific flags
6 As in timerfd.h, eventfd.h needs arch-specific definition files.
7 alpha, mips and sparc needs separate file, all the other arch
8 will use common definition.
10 This problem is already fixed in glibc.
12 Also sanitize and provide bits for hppa.
13 Make sure not to install the new bits/eventfd unless eventfd support is
16 Signed-off-by: Hiroaki KAWAI <kawai@stratosphere.co.jp>
17 Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
21 @@ -272,6 +272,7 @@ HEADERS_RM-$(UCLIBC_HAS_XATTR)
22 HEADERS_RM-$(UCLIBC_HAS_XLOCALE) += xlocale.h
23 HEADERS_RM-$(UCLIBC_LINUX_SPECIFIC) += sys/eventfd.h sys/fsuid.h \
30 +++ b/libc/sysdeps/linux/alpha/bits/eventfd.h
32 +/* Copyright (C) 2007-2013 Free Software Foundation, Inc.
33 + This file is part of the GNU C Library.
35 + The GNU C Library is free software; you can redistribute it and/or
36 + modify it under the terms of the GNU Lesser General Public
37 + License as published by the Free Software Foundation; either
38 + version 2.1 of the License, or (at your option) any later version.
40 + The GNU C Library is distributed in the hope that it will be useful,
41 + but WITHOUT ANY WARRANTY; without even the implied warranty of
42 + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
43 + Lesser General Public License for more details.
45 + You should have received a copy of the GNU Lesser General Public
46 + License along with the GNU C Library; if not, see
47 + <http://www.gnu.org/licenses/>. */
49 +#ifndef _SYS_EVENTFD_H
50 +# error "Never use <bits/eventfd.h> directly; include <sys/eventfd.h> instead."
53 +/* Flags for eventfd. */
56 + EFD_SEMAPHORE = 000000001,
57 +#define EFD_SEMAPHORE EFD_SEMAPHORE
58 + EFD_CLOEXEC = 010000000,
59 +#define EFD_CLOEXEC EFD_CLOEXEC
60 + EFD_NONBLOCK = 000000004
61 +#define EFD_NONBLOCK EFD_NONBLOCK
64 +++ b/libc/sysdeps/linux/common/bits/eventfd.h
66 +/* Copyright (C) 2007-2013 Free Software Foundation, Inc.
67 + This file is part of the GNU C Library.
69 + The GNU C Library is free software; you can redistribute it and/or
70 + modify it under the terms of the GNU Lesser General Public
71 + License as published by the Free Software Foundation; either
72 + version 2.1 of the License, or (at your option) any later version.
74 + The GNU C Library is distributed in the hope that it will be useful,
75 + but WITHOUT ANY WARRANTY; without even the implied warranty of
76 + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
77 + Lesser General Public License for more details.
79 + You should have received a copy of the GNU Lesser General Public
80 + License along with the GNU C Library; if not, see
81 + <http://www.gnu.org/licenses/>. */
83 +#ifndef _SYS_EVENTFD_H
84 +# error "Never use <bits/eventfd.h> directly; include <sys/eventfd.h> instead."
87 +/* Flags for eventfd. */
90 + EFD_SEMAPHORE = 00000001,
91 +#define EFD_SEMAPHORE EFD_SEMAPHORE
92 + EFD_CLOEXEC = 02000000,
93 +#define EFD_CLOEXEC EFD_CLOEXEC
94 + EFD_NONBLOCK = 00004000
95 +#define EFD_NONBLOCK EFD_NONBLOCK
97 --- a/libc/sysdeps/linux/common/sys/eventfd.h
98 +++ b/libc/sysdeps/linux/common/sys/eventfd.h
100 -/* Copyright (C) 2007, 2008, 2009 Free Software Foundation, Inc.
101 +/* Copyright (C) 2007-2013 Free Software Foundation, Inc.
102 This file is part of the GNU C Library.
104 The GNU C Library is free software; you can redistribute it and/or
109 +/* Get the platform-dependent flags. */
110 +#include <bits/eventfd.h>
112 /* Type for event counter. */
113 typedef uint64_t eventfd_t;
115 -/* Flags for signalfd. */
119 -#define EFD_SEMAPHORE EFD_SEMAPHORE
120 - EFD_CLOEXEC = 02000000,
121 -#define EFD_CLOEXEC EFD_CLOEXEC
122 - EFD_NONBLOCK = 04000
123 -#define EFD_NONBLOCK EFD_NONBLOCK
129 @@ -43,6 +34,16 @@ __BEGIN_DECLS
131 extern int eventfd (int __count, int __flags) __THROW;
133 +#if 0 /* not (yet) implemented in uClibc */
135 +/* Read event counter and possibly wait for events. */
136 +extern int eventfd_read (int __fd, eventfd_t *__value);
138 +/* Increment event counter. */
139 +extern int eventfd_write (int __fd, eventfd_t __value);
145 #endif /* sys/eventfd.h */
147 +++ b/libc/sysdeps/linux/hppa/bits/eventfd.h
149 +/* Copyright (C) 2007-2013 Free Software Foundation, Inc.
150 + This file is part of the GNU C Library.
152 + The GNU C Library is free software; you can redistribute it and/or
153 + modify it under the terms of the GNU Lesser General Public
154 + License as published by the Free Software Foundation; either
155 + version 2.1 of the License, or (at your option) any later version.
157 + The GNU C Library is distributed in the hope that it will be useful,
158 + but WITHOUT ANY WARRANTY; without even the implied warranty of
159 + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
160 + Lesser General Public License for more details.
162 + You should have received a copy of the GNU Lesser General Public
163 + License along with the GNU C Library. If not, see
164 + <http://www.gnu.org/licenses/>. */
166 +#ifndef _SYS_EVENTFD_H
167 +# error "Never use <bits/eventfd.h> directly; include <sys/eventfd.h> instead."
170 +/* Flags for signalfd. */
173 + EFD_SEMAPHORE = 000000001,
174 +#define EFD_SEMAPHORE EFD_SEMAPHORE
175 + EFD_CLOEXEC = 010000000,
176 +#define EFD_CLOEXEC EFD_CLOEXEC
177 +/* the below value looks suspicious, should be 000200004 for consistency */
178 + EFD_NONBLOCK = 00200004 /* HPUX has separate NDELAY & NONBLOCK */
179 +#define EFD_NONBLOCK EFD_NONBLOCK
182 +++ b/libc/sysdeps/linux/mips/bits/eventfd.h
184 +/* Copyright (C) 2007-2013 Free Software Foundation, Inc.
185 + This file is part of the GNU C Library.
187 + The GNU C Library is free software; you can redistribute it and/or
188 + modify it under the terms of the GNU Lesser General Public
189 + License as published by the Free Software Foundation; either
190 + version 2.1 of the License, or (at your option) any later version.
192 + The GNU C Library is distributed in the hope that it will be useful,
193 + but WITHOUT ANY WARRANTY; without even the implied warranty of
194 + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
195 + Lesser General Public License for more details.
197 + You should have received a copy of the GNU Lesser General Public
198 + License along with the GNU C Library; if not, see
199 + <http://www.gnu.org/licenses/>. */
201 +#ifndef _SYS_EVENTFD_H
202 +# error "Never use <bits/eventfd.h> directly; include <sys/eventfd.h> instead."
205 +/* Flags for eventfd. */
208 + EFD_SEMAPHORE = 00000001,
209 +#define EFD_SEMAPHORE EFD_SEMAPHORE
210 + EFD_CLOEXEC = 02000000,
211 +#define EFD_CLOEXEC EFD_CLOEXEC
212 + EFD_NONBLOCK = 00000200
213 +#define EFD_NONBLOCK EFD_NONBLOCK
216 +++ b/libc/sysdeps/linux/sparc/bits/eventfd.h
218 +/* Copyright (C) 2007-2013 Free Software Foundation, Inc.
219 + This file is part of the GNU C Library.
221 + The GNU C Library is free software; you can redistribute it and/or
222 + modify it under the terms of the GNU Lesser General Public
223 + License as published by the Free Software Foundation; either
224 + version 2.1 of the License, or (at your option) any later version.
226 + The GNU C Library is distributed in the hope that it will be useful,
227 + but WITHOUT ANY WARRANTY; without even the implied warranty of
228 + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
229 + Lesser General Public License for more details.
231 + You should have received a copy of the GNU Lesser General Public
232 + License along with the GNU C Library; if not, see
233 + <http://www.gnu.org/licenses/>. */
235 +#ifndef _SYS_EVENTFD_H
236 +# error "Never use <bits/eventfd.h> directly; include <sys/eventfd.h> instead."
239 +/* Flags for eventfd. */
243 +#define EFD_SEMAPHORE EFD_SEMAPHORE
244 + EFD_CLOEXEC = 0x400000,
245 +#define EFD_CLOEXEC EFD_CLOEXEC
246 + EFD_NONBLOCK = 0x004000
247 +#define EFD_NONBLOCK EFD_NONBLOCK