3d966ff75231898e302336a086165b348a0ce899
[packages/trusty/cirros-testvm.git] / cirros-testvm / src-cirros / buildroot-2015.05 / package / uclibc / 0.9.33.2 / 0055-Use-new-bits-scheme-for-arch-specific-flag.patch
1 From c1a78badec59b1ebd303ace8257ca86fa1e14acb Mon Sep 17 00:00:00 2001
2 From: Hiroaki KAWAI <kawai@stratosphere.co.jp>
3 Date: Fri, 19 Apr 2013 10:09:35 +0900
4 Subject: [PATCH-0.9.33] eventfd.h: Use new "bits/" scheme for arch-specific flags
5
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.
9
10 This problem is already fixed in glibc.
11
12 Also sanitize and provide bits for hppa.
13 Make sure not to install the new bits/eventfd unless eventfd support is
14 enabled.
15
16 Signed-off-by: Hiroaki KAWAI <kawai@stratosphere.co.jp>
17 Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
18 ---
19  Makefile.in                              |  1 +
20  libc/sysdeps/linux/alpha/bits/eventfd.h  | 31 +++++++++++++++++++++++++++++++
21  libc/sysdeps/linux/common/bits/eventfd.h | 31 +++++++++++++++++++++++++++++++
22  libc/sysdeps/linux/common/sys/eventfd.h  | 25 +++++++++++++------------
23  libc/sysdeps/linux/hppa/bits/eventfd.h   | 32 ++++++++++++++++++++++++++++++++
24  libc/sysdeps/linux/mips/bits/eventfd.h   | 31 +++++++++++++++++++++++++++++++
25  libc/sysdeps/linux/sparc/bits/eventfd.h  | 31 +++++++++++++++++++++++++++++++
26  7 files changed, 170 insertions(+), 12 deletions(-)
27  create mode 100644 libc/sysdeps/linux/alpha/bits/eventfd.h
28  create mode 100644 libc/sysdeps/linux/common/bits/eventfd.h
29  create mode 100644 libc/sysdeps/linux/hppa/bits/eventfd.h
30  create mode 100644 libc/sysdeps/linux/mips/bits/eventfd.h
31  create mode 100644 libc/sysdeps/linux/sparc/bits/eventfd.h
32
33 diff --git a/Makefile.in b/Makefile.in
34 index 9ba590d..633358f 100644
35 --- a/Makefile.in
36 +++ b/Makefile.in
37 @@ -271,6 +271,7 @@ HEADERS_RM-$(UCLIBC_HAS_WORDEXP)             += wordexp.h
38  HEADERS_RM-$(UCLIBC_HAS_XATTR)               += sys/xattr.h
39  HEADERS_RM-$(UCLIBC_HAS_XLOCALE)             += xlocale.h
40  HEADERS_RM-$(UCLIBC_LINUX_SPECIFIC)          += sys/eventfd.h sys/fsuid.h \
41 +       bits/eventfd.h \
42         bits/inotify.h \
43         sys/inotify.h \
44         sys/kdaemon.h \
45 diff --git a/libc/sysdeps/linux/alpha/bits/eventfd.h b/libc/sysdeps/linux/alpha/bits/eventfd.h
46 new file mode 100644
47 index 0000000..b5a7e41
48 --- /dev/null
49 +++ b/libc/sysdeps/linux/alpha/bits/eventfd.h
50 @@ -0,0 +1,31 @@
51 +/* Copyright (C) 2007-2013 Free Software Foundation, Inc.
52 +   This file is part of the GNU C Library.
53 +
54 +   The GNU C Library is free software; you can redistribute it and/or
55 +   modify it under the terms of the GNU Lesser General Public
56 +   License as published by the Free Software Foundation; either
57 +   version 2.1 of the License, or (at your option) any later version.
58 +
59 +   The GNU C Library is distributed in the hope that it will be useful,
60 +   but WITHOUT ANY WARRANTY; without even the implied warranty of
61 +   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
62 +   Lesser General Public License for more details.
63 +
64 +   You should have received a copy of the GNU Lesser General Public
65 +   License along with the GNU C Library; if not, see
66 +   <http://www.gnu.org/licenses/>.  */
67 +
68 +#ifndef        _SYS_EVENTFD_H
69 +# error "Never use <bits/eventfd.h> directly; include <sys/eventfd.h> instead."
70 +#endif
71 +
72 +/* Flags for eventfd.  */
73 +enum
74 +  {
75 +    EFD_SEMAPHORE = 000000001,
76 +#define EFD_SEMAPHORE EFD_SEMAPHORE
77 +    EFD_CLOEXEC   = 010000000,
78 +#define EFD_CLOEXEC EFD_CLOEXEC
79 +    EFD_NONBLOCK  = 000000004
80 +#define EFD_NONBLOCK EFD_NONBLOCK
81 +  };
82 diff --git a/libc/sysdeps/linux/common/bits/eventfd.h b/libc/sysdeps/linux/common/bits/eventfd.h
83 new file mode 100644
84 index 0000000..ef49c61
85 --- /dev/null
86 +++ b/libc/sysdeps/linux/common/bits/eventfd.h
87 @@ -0,0 +1,31 @@
88 +/* Copyright (C) 2007-2013 Free Software Foundation, Inc.
89 +   This file is part of the GNU C Library.
90 +
91 +   The GNU C Library is free software; you can redistribute it and/or
92 +   modify it under the terms of the GNU Lesser General Public
93 +   License as published by the Free Software Foundation; either
94 +   version 2.1 of the License, or (at your option) any later version.
95 +
96 +   The GNU C Library is distributed in the hope that it will be useful,
97 +   but WITHOUT ANY WARRANTY; without even the implied warranty of
98 +   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
99 +   Lesser General Public License for more details.
100 +
101 +   You should have received a copy of the GNU Lesser General Public
102 +   License along with the GNU C Library; if not, see
103 +   <http://www.gnu.org/licenses/>.  */
104 +
105 +#ifndef        _SYS_EVENTFD_H
106 +# error "Never use <bits/eventfd.h> directly; include <sys/eventfd.h> instead."
107 +#endif
108 +
109 +/* Flags for eventfd.  */
110 +enum
111 +  {
112 +    EFD_SEMAPHORE = 00000001,
113 +#define EFD_SEMAPHORE EFD_SEMAPHORE
114 +    EFD_CLOEXEC = 02000000,
115 +#define EFD_CLOEXEC EFD_CLOEXEC
116 +    EFD_NONBLOCK = 00004000
117 +#define EFD_NONBLOCK EFD_NONBLOCK
118 +  };
119 diff --git a/libc/sysdeps/linux/common/sys/eventfd.h b/libc/sysdeps/linux/common/sys/eventfd.h
120 index 311f803..8686355 100644
121 --- a/libc/sysdeps/linux/common/sys/eventfd.h
122 +++ b/libc/sysdeps/linux/common/sys/eventfd.h
123 @@ -1,4 +1,4 @@
124 -/* Copyright (C) 2007, 2008, 2009 Free Software Foundation, Inc.
125 +/* Copyright (C) 2007-2013 Free Software Foundation, Inc.
126     This file is part of the GNU C Library.
127  
128     The GNU C Library is free software; you can redistribute it and/or
129 @@ -21,21 +21,12 @@
130  
131  #include <stdint.h>
132  
133 +/* Get the platform-dependent flags.  */
134 +#include <bits/eventfd.h>
135  
136  /* Type for event counter.  */
137  typedef uint64_t eventfd_t;
138  
139 -/* Flags for signalfd.  */
140 -enum
141 -  {
142 -    EFD_SEMAPHORE = 1,
143 -#define EFD_SEMAPHORE EFD_SEMAPHORE
144 -    EFD_CLOEXEC = 02000000,
145 -#define EFD_CLOEXEC EFD_CLOEXEC
146 -    EFD_NONBLOCK = 04000
147 -#define EFD_NONBLOCK EFD_NONBLOCK
148 -  };
149 -
150  
151  __BEGIN_DECLS
152  
153 @@ -43,6 +34,16 @@ __BEGIN_DECLS
154     value to COUNT.  */
155  extern int eventfd (int __count, int __flags) __THROW;
156  
157 +#if 0 /* not (yet) implemented in uClibc */
158 +
159 +/* Read event counter and possibly wait for events.  */
160 +extern int eventfd_read (int __fd, eventfd_t *__value);
161 +
162 +/* Increment event counter.  */
163 +extern int eventfd_write (int __fd, eventfd_t __value);
164 +
165 +#endif
166 +
167  __END_DECLS
168  
169  #endif /* sys/eventfd.h */
170 diff --git a/libc/sysdeps/linux/hppa/bits/eventfd.h b/libc/sysdeps/linux/hppa/bits/eventfd.h
171 new file mode 100644
172 index 0000000..6182c07
173 --- /dev/null
174 +++ b/libc/sysdeps/linux/hppa/bits/eventfd.h
175 @@ -0,0 +1,32 @@
176 +/* Copyright (C) 2007-2013 Free Software Foundation, Inc.
177 +   This file is part of the GNU C Library.
178 +
179 +   The GNU C Library is free software; you can redistribute it and/or
180 +   modify it under the terms of the GNU Lesser General Public
181 +   License as published by the Free Software Foundation; either
182 +   version 2.1 of the License, or (at your option) any later version.
183 +
184 +   The GNU C Library is distributed in the hope that it will be useful,
185 +   but WITHOUT ANY WARRANTY; without even the implied warranty of
186 +   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
187 +   Lesser General Public License for more details.
188 +
189 +   You should have received a copy of the GNU Lesser General Public
190 +   License along with the GNU C Library.  If not, see
191 +   <http://www.gnu.org/licenses/>.  */
192 +
193 +#ifndef        _SYS_EVENTFD_H
194 +# error "Never use <bits/eventfd.h> directly; include <sys/eventfd.h> instead."
195 +#endif
196 +
197 +/* Flags for signalfd.  */
198 +enum
199 +  {
200 +    EFD_SEMAPHORE = 000000001,
201 +#define EFD_SEMAPHORE EFD_SEMAPHORE
202 +    EFD_CLOEXEC   = 010000000,
203 +#define EFD_CLOEXEC EFD_CLOEXEC
204 +/* the below value looks suspicious, should be 000200004 for consistency */
205 +    EFD_NONBLOCK  = 00200004 /* HPUX has separate NDELAY & NONBLOCK */
206 +#define EFD_NONBLOCK EFD_NONBLOCK
207 +  };
208 diff --git a/libc/sysdeps/linux/mips/bits/eventfd.h b/libc/sysdeps/linux/mips/bits/eventfd.h
209 new file mode 100644
210 index 0000000..17b2f46
211 --- /dev/null
212 +++ b/libc/sysdeps/linux/mips/bits/eventfd.h
213 @@ -0,0 +1,31 @@
214 +/* Copyright (C) 2007-2013 Free Software Foundation, Inc.
215 +   This file is part of the GNU C Library.
216 +
217 +   The GNU C Library is free software; you can redistribute it and/or
218 +   modify it under the terms of the GNU Lesser General Public
219 +   License as published by the Free Software Foundation; either
220 +   version 2.1 of the License, or (at your option) any later version.
221 +
222 +   The GNU C Library is distributed in the hope that it will be useful,
223 +   but WITHOUT ANY WARRANTY; without even the implied warranty of
224 +   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
225 +   Lesser General Public License for more details.
226 +
227 +   You should have received a copy of the GNU Lesser General Public
228 +   License along with the GNU C Library; if not, see
229 +   <http://www.gnu.org/licenses/>.  */
230 +
231 +#ifndef        _SYS_EVENTFD_H
232 +# error "Never use <bits/eventfd.h> directly; include <sys/eventfd.h> instead."
233 +#endif
234 +
235 +/* Flags for eventfd.  */
236 +enum
237 +  {
238 +    EFD_SEMAPHORE = 00000001,
239 +#define EFD_SEMAPHORE EFD_SEMAPHORE
240 +    EFD_CLOEXEC = 02000000,
241 +#define EFD_CLOEXEC EFD_CLOEXEC
242 +    EFD_NONBLOCK = 00000200
243 +#define EFD_NONBLOCK EFD_NONBLOCK
244 +  };
245 diff --git a/libc/sysdeps/linux/sparc/bits/eventfd.h b/libc/sysdeps/linux/sparc/bits/eventfd.h
246 new file mode 100644
247 index 0000000..bed9f09
248 --- /dev/null
249 +++ b/libc/sysdeps/linux/sparc/bits/eventfd.h
250 @@ -0,0 +1,31 @@
251 +/* Copyright (C) 2007-2013 Free Software Foundation, Inc.
252 +   This file is part of the GNU C Library.
253 +
254 +   The GNU C Library is free software; you can redistribute it and/or
255 +   modify it under the terms of the GNU Lesser General Public
256 +   License as published by the Free Software Foundation; either
257 +   version 2.1 of the License, or (at your option) any later version.
258 +
259 +   The GNU C Library is distributed in the hope that it will be useful,
260 +   but WITHOUT ANY WARRANTY; without even the implied warranty of
261 +   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
262 +   Lesser General Public License for more details.
263 +
264 +   You should have received a copy of the GNU Lesser General Public
265 +   License along with the GNU C Library; if not, see
266 +   <http://www.gnu.org/licenses/>.  */
267 +
268 +#ifndef        _SYS_EVENTFD_H
269 +# error "Never use <bits/eventfd.h> directly; include <sys/eventfd.h> instead."
270 +#endif
271 +
272 +/* Flags for eventfd.  */
273 +enum
274 +  {
275 +    EFD_SEMAPHORE = 1,
276 +#define EFD_SEMAPHORE EFD_SEMAPHORE
277 +    EFD_CLOEXEC = 0x400000,
278 +#define EFD_CLOEXEC EFD_CLOEXEC
279 +    EFD_NONBLOCK = 0x004000
280 +#define EFD_NONBLOCK EFD_NONBLOCK
281 +  };
282 -- 
283 1.8.1.2
284