summaryrefslogtreecommitdiffstats
path: root/meta-oe
diff options
context:
space:
mode:
authorKhem Raj <raj.khem@gmail.com>2011-05-17 02:27:56 +0000
committerKoen Kooi <koen@dominion.thruhere.net>2011-05-16 20:50:44 +0200
commit9c5f5a80700cf57ecc70d0356979f1281fae0d61 (patch)
tree64a58ca9f2e948edb225d3352959141090649b8a /meta-oe
parent01e28b89e6c082653c0d7efa8dc19cd104fd42c8 (diff)
downloadmeta-openembedded-9c5f5a80700cf57ecc70d0356979f1281fae0d61.tar.gz
uclibc_git.bb: Backport epoll implementation
Many applications e.g. firefox need it Signed-off-by: Khem Raj <raj.khem@gmail.com> Signed-off-by: Koen Kooi <koen@dominion.thruhere.net>
Diffstat (limited to 'meta-oe')
-rw-r--r--meta-oe/recipes-core/uclibc/uclibc-git/uclibc-epoll.patch378
-rw-r--r--meta-oe/recipes-core/uclibc/uclibc_git.bb3
2 files changed, 380 insertions, 1 deletions
diff --git a/meta-oe/recipes-core/uclibc/uclibc-git/uclibc-epoll.patch b/meta-oe/recipes-core/uclibc/uclibc-git/uclibc-epoll.patch
new file mode 100644
index 000000000..5d0cdeda9
--- /dev/null
+++ b/meta-oe/recipes-core/uclibc/uclibc-git/uclibc-epoll.patch
@@ -0,0 +1,378 @@
1From 00c44b9f566f34d1fa3f2889771730b8496b6f95 Mon Sep 17 00:00:00 2001
2From: Peter S. Mazinger <ps.m@gmx.net>
3Date: Tue, 22 Mar 2011 00:02:10 +0000
4Subject: add epoll_pwait()
5
6Add epoll.h header for sparc.
7Update epoll.h from glibc (disabling though epoll_create1).
8
9Signed-off-by: Peter S. Mazinger <ps.m@gmx.net>
10---
11diff --git a/libc/sysdeps/linux/common/epoll.c b/libc/sysdeps/linux/common/epoll.c
12index dda9228..4fbba16 100644
13--- a/libc/sysdeps/linux/common/epoll.c
14+++ b/libc/sysdeps/linux/common/epoll.c
15@@ -1,6 +1,6 @@
16 /* vi: set sw=4 ts=4: */
17 /*
18- * epoll_create() / epoll_ctl() / epoll_wait() for uClibc
19+ * epoll_create() / epoll_ctl() / epoll_wait() / epoll_pwait() for uClibc
20 *
21 * Copyright (C) 2000-2006 Erik Andersen <andersen@uclibc.org>
22 *
23@@ -10,23 +10,19 @@
24 #include <sys/syscall.h>
25 #include <sys/epoll.h>
26
27-/*
28- * epoll_create()
29- */
30 #ifdef __NR_epoll_create
31 _syscall1(int, epoll_create, int, size)
32 #endif
33
34-/*
35- * epoll_ctl()
36- */
37 #ifdef __NR_epoll_ctl
38-_syscall4(int,epoll_ctl, int, epfd, int, op, int, fd, struct epoll_event *, event)
39+_syscall4(int, epoll_ctl, int, epfd, int, op, int, fd, struct epoll_event *, event)
40 #endif
41
42-/*
43- * epoll_wait()
44- */
45 #ifdef __NR_epoll_wait
46 _syscall4(int, epoll_wait, int, epfd, struct epoll_event *, events, int, maxevents, int, timeout)
47 #endif
48+
49+#ifdef __NR_epoll_pwait
50+_syscall5(int, epoll_pwait, int, epfd, struct epoll_event *, events, int, maxevents, int, timeout,
51+ const sigset_t *, ss)
52+#endif
53diff --git a/libc/sysdeps/linux/common/stubs.c b/libc/sysdeps/linux/common/stubs.c
54index 655c640..0e740b1 100644
55--- a/libc/sysdeps/linux/common/stubs.c
56+++ b/libc/sysdeps/linux/common/stubs.c
57@@ -63,6 +63,10 @@ make_stub(epoll_ctl)
58 make_stub(epoll_wait)
59 #endif
60
61+#ifndef __NR_epoll_pwait
62+make_stub(epoll_pwait)
63+#endif
64+
65 #ifndef __NR_fdatasync
66 make_stub(fdatasync)
67 #endif
68diff --git a/libc/sysdeps/linux/common/sys/epoll.h b/libc/sysdeps/linux/common/sys/epoll.h
69index 44e814b..bf196d2 100644
70--- a/libc/sysdeps/linux/common/sys/epoll.h
71+++ b/libc/sysdeps/linux/common/sys/epoll.h
72@@ -1,4 +1,4 @@
73-/* Copyright (C) 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
74+/* Copyright (C) 2002-2006, 2007, 2008, 2009 Free Software Foundation, Inc.
75 This file is part of the GNU C Library.
76
77 The GNU C Library is free software; you can redistribute it and/or
78@@ -22,6 +22,26 @@
79 #include <stdint.h>
80 #include <sys/types.h>
81
82+/* Get __sigset_t. */
83+#include <bits/sigset.h>
84+
85+#ifndef __sigset_t_defined
86+# define __sigset_t_defined
87+typedef __sigset_t sigset_t;
88+#endif
89+
90+
91+#if 0
92+/* Flags to be passed to epoll_create1. */
93+enum
94+ {
95+ EPOLL_CLOEXEC = 02000000,
96+#define EPOLL_CLOEXEC EPOLL_CLOEXEC
97+ EPOLL_NONBLOCK = 04000
98+#define EPOLL_NONBLOCK EPOLL_NONBLOCK
99+ };
100+#endif
101+
102
103 enum EPOLL_EVENTS
104 {
105@@ -55,9 +75,9 @@ enum EPOLL_EVENTS
106
107
108 /* Valid opcodes ( "op" parameter ) to issue to epoll_ctl(). */
109-#define EPOLL_CTL_ADD 1 /* Add a file decriptor to the interface. */
110-#define EPOLL_CTL_DEL 2 /* Remove a file decriptor from the interface. */
111-#define EPOLL_CTL_MOD 3 /* Change file decriptor epoll_event structure. */
112+#define EPOLL_CTL_ADD 1 /* Add a file descriptor to the interface. */
113+#define EPOLL_CTL_DEL 2 /* Remove a file descriptor from the interface. */
114+#define EPOLL_CTL_MOD 3 /* Change file descriptor epoll_event structure. */
115
116
117 typedef union epoll_data
118@@ -83,6 +103,12 @@ __BEGIN_DECLS
119 returned by epoll_create() should be closed with close(). */
120 extern int epoll_create (int __size) __THROW;
121
122+#if 0
123+/* Same as epoll_create but with an FLAGS parameter. The unused SIZE
124+ parameter has been dropped. */
125+extern int epoll_create1 (int __flags) __THROW;
126+#endif
127+
128
129 /* Manipulate an epoll instance "epfd". Returns 0 in case of success,
130 -1 in case of error ( the "errno" variable will contain the
131@@ -107,6 +133,16 @@ extern int epoll_ctl (int __epfd, int __op, int __fd,
132 extern int epoll_wait (int __epfd, struct epoll_event *__events,
133 int __maxevents, int __timeout);
134
135+
136+/* Same as epoll_wait, but the thread's signal mask is temporarily
137+ and atomically replaced with the one provided as parameter.
138+
139+ This function is a cancellation point and therefore not marked with
140+ __THROW. */
141+extern int epoll_pwait (int __epfd, struct epoll_event *__events,
142+ int __maxevents, int __timeout,
143+ __const __sigset_t *__ss);
144+
145 __END_DECLS
146
147 #endif /* sys/epoll.h */
148diff --git a/libc/sysdeps/linux/sparc/sys/epoll.h b/libc/sysdeps/linux/sparc/sys/epoll.h
149new file mode 100644
150index 0000000..83a61da
151--- a/dev/null
152+++ b/libc/sysdeps/linux/sparc/sys/epoll.h
153@@ -0,0 +1,147 @@
154+/* Copyright (C) 2002-2006, 2007, 2008 Free Software Foundation, Inc.
155+ This file is part of the GNU C Library.
156+
157+ The GNU C Library is free software; you can redistribute it and/or
158+ modify it under the terms of the GNU Lesser General Public
159+ License as published by the Free Software Foundation; either
160+ version 2.1 of the License, or (at your option) any later version.
161+
162+ The GNU C Library is distributed in the hope that it will be useful,
163+ but WITHOUT ANY WARRANTY; without even the implied warranty of
164+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
165+ Lesser General Public License for more details.
166+
167+ You should have received a copy of the GNU Lesser General Public
168+ License along with the GNU C Library; if not, write to the Free
169+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
170+ 02111-1307 USA. */
171+
172+#ifndef _SYS_EPOLL_H
173+#define _SYS_EPOLL_H 1
174+
175+#include <stdint.h>
176+#include <sys/types.h>
177+
178+/* Get __sigset_t. */
179+#include <bits/sigset.h>
180+
181+#ifndef __sigset_t_defined
182+# define __sigset_t_defined
183+typedef __sigset_t sigset_t;
184+#endif
185+
186+
187+#if 0
188+/* Flags to be passed to epoll_create2. */
189+enum
190+ {
191+ EPOLL_CLOEXEC = 0x400000,
192+#define EPOLL_CLOEXEC EPOLL_CLOEXEC
193+ EPOLL_NONBLOCK = 0x4000
194+#define EPOLL_NONBLOCK EPOLL_NONBLOCK
195+ };
196+#endif
197+
198+
199+enum EPOLL_EVENTS
200+ {
201+ EPOLLIN = 0x001,
202+#define EPOLLIN EPOLLIN
203+ EPOLLPRI = 0x002,
204+#define EPOLLPRI EPOLLPRI
205+ EPOLLOUT = 0x004,
206+#define EPOLLOUT EPOLLOUT
207+ EPOLLRDNORM = 0x040,
208+#define EPOLLRDNORM EPOLLRDNORM
209+ EPOLLRDBAND = 0x080,
210+#define EPOLLRDBAND EPOLLRDBAND
211+ EPOLLWRNORM = 0x100,
212+#define EPOLLWRNORM EPOLLWRNORM
213+ EPOLLWRBAND = 0x200,
214+#define EPOLLWRBAND EPOLLWRBAND
215+ EPOLLMSG = 0x400,
216+#define EPOLLMSG EPOLLMSG
217+ EPOLLERR = 0x008,
218+#define EPOLLERR EPOLLERR
219+ EPOLLHUP = 0x010,
220+#define EPOLLHUP EPOLLHUP
221+ EPOLLRDHUP = 0x2000,
222+#define EPOLLRDHUP EPOLLRDHUP
223+ EPOLLONESHOT = (1 << 30),
224+#define EPOLLONESHOT EPOLLONESHOT
225+ EPOLLET = (1 << 31)
226+#define EPOLLET EPOLLET
227+ };
228+
229+
230+/* Valid opcodes ( "op" parameter ) to issue to epoll_ctl(). */
231+#define EPOLL_CTL_ADD 1 /* Add a file descriptor to the interface. */
232+#define EPOLL_CTL_DEL 2 /* Remove a file descriptor from the interface. */
233+#define EPOLL_CTL_MOD 3 /* Change file descriptor epoll_event structure. */
234+
235+
236+typedef union epoll_data
237+{
238+ void *ptr;
239+ int fd;
240+ uint32_t u32;
241+ uint64_t u64;
242+} epoll_data_t;
243+
244+struct epoll_event
245+{
246+ uint32_t events; /* Epoll events */
247+ epoll_data_t data; /* User data variable */
248+};
249+
250+
251+__BEGIN_DECLS
252+
253+/* Creates an epoll instance. Returns an fd for the new instance.
254+ The "size" parameter is a hint specifying the number of file
255+ descriptors to be associated with the new instance. The fd
256+ returned by epoll_create() should be closed with close(). */
257+extern int epoll_create (int __size) __THROW;
258+
259+#if 0
260+/* Same as epoll_create but with an additional FLAGS parameter. */
261+extern int epoll_create2 (int __size, int __flags) __THROW;
262+#endif
263+
264+
265+/* Manipulate an epoll instance "epfd". Returns 0 in case of success,
266+ -1 in case of error ( the "errno" variable will contain the
267+ specific error code ) The "op" parameter is one of the EPOLL_CTL_*
268+ constants defined above. The "fd" parameter is the target of the
269+ operation. The "event" parameter describes which events the caller
270+ is interested in and any associated user data. */
271+extern int epoll_ctl (int __epfd, int __op, int __fd,
272+ struct epoll_event *__event) __THROW;
273+
274+
275+/* Wait for events on an epoll instance "epfd". Returns the number of
276+ triggered events returned in "events" buffer. Or -1 in case of
277+ error with the "errno" variable set to the specific error code. The
278+ "events" parameter is a buffer that will contain triggered
279+ events. The "maxevents" is the maximum number of events to be
280+ returned ( usually size of "events" ). The "timeout" parameter
281+ specifies the maximum wait time in milliseconds (-1 == infinite).
282+
283+ This function is a cancellation point and therefore not marked with
284+ __THROW. */
285+extern int epoll_wait (int __epfd, struct epoll_event *__events,
286+ int __maxevents, int __timeout);
287+
288+
289+/* Same as epoll_wait, but the thread's signal mask is temporarily
290+ and atomically replaced with the one provided as parameter.
291+
292+ This function is a cancellation point and therefore not marked with
293+ __THROW. */
294+extern int epoll_pwait (int __epfd, struct epoll_event *__events,
295+ int __maxevents, int __timeout,
296+ __const __sigset_t *__ss);
297+
298+__END_DECLS
299+
300+#endif /* sys/epoll.h */
301diff --git a/libc/sysdeps/linux/x86_64/sys/epoll.h b/libc/sysdeps/linux/x86_64/sys/epoll.h
302index 02672d3..6b90d54 100644
303--- a/libc/sysdeps/linux/x86_64/sys/epoll.h
304+++ b/libc/sysdeps/linux/x86_64/sys/epoll.h
305@@ -1,4 +1,4 @@
306-/* Copyright (C) 2002,2003,2004,2005,2006 Free Software Foundation, Inc.
307+/* Copyright (C) 2002,2003,2004,2005,2006,2007,2008 Free Software Foundation, Inc.
308 This file is part of the GNU C Library.
309
310 The GNU C Library is free software; you can redistribute it and/or
311@@ -22,6 +22,26 @@
312 #include <stdint.h>
313 #include <sys/types.h>
314
315+/* Get __sigset_t. */
316+#include <bits/sigset.h>
317+
318+#ifndef __sigset_t_defined
319+# define __sigset_t_defined
320+typedef __sigset_t sigset_t;
321+#endif
322+
323+
324+#if 0
325+/* Flags to be passed to epoll_create1. */
326+enum
327+ {
328+ EPOLL_CLOEXEC = 02000000,
329+#define EPOLL_CLOEXEC EPOLL_CLOEXEC
330+ EPOLL_NONBLOCK = 04000
331+#define EPOLL_NONBLOCK EPOLL_NONBLOCK
332+ };
333+#endif
334+
335
336 enum EPOLL_EVENTS
337 {
338@@ -45,6 +65,8 @@ enum EPOLL_EVENTS
339 #define EPOLLERR EPOLLERR
340 EPOLLHUP = 0x010,
341 #define EPOLLHUP EPOLLHUP
342+ EPOLLRDHUP = 0x2000,
343+#define EPOLLRDHUP EPOLLRDHUP
344 EPOLLONESHOT = (1 << 30),
345 #define EPOLLONESHOT EPOLLONESHOT
346 EPOLLET = (1 << 31)
347@@ -81,6 +103,12 @@ __BEGIN_DECLS
348 returned by epoll_create() should be closed with close(). */
349 extern int epoll_create (int __size) __THROW;
350
351+#if 0
352+/* Same as epoll_create but with an FLAGS parameter. The unused SIZE
353+ parameter has been dropped. */
354+extern int epoll_create1 (int __flags) __THROW;
355+#endif
356+
357
358 /* Manipulate an epoll instance "epfd". Returns 0 in case of success,
359 -1 in case of error ( the "errno" variable will contain the
360@@ -105,6 +133,16 @@ extern int epoll_ctl (int __epfd, int __op, int __fd,
361 extern int epoll_wait (int __epfd, struct epoll_event *__events,
362 int __maxevents, int __timeout);
363
364+
365+/* Same as epoll_wait, but the thread's signal mask is temporarily
366+ and atomically replaced with the one provided as parameter.
367+
368+ This function is a cancellation point and therefore not marked with
369+ __THROW. */
370+extern int epoll_pwait (int __epfd, struct epoll_event *__events,
371+ int __maxevents, int __timeout,
372+ __const __sigset_t *__ss);
373+
374 __END_DECLS
375
376 #endif /* sys/epoll.h */
377--
378cgit v0.8.2.1
diff --git a/meta-oe/recipes-core/uclibc/uclibc_git.bb b/meta-oe/recipes-core/uclibc/uclibc_git.bb
index 3719ea24d..cbc8ab8c7 100644
--- a/meta-oe/recipes-core/uclibc/uclibc_git.bb
+++ b/meta-oe/recipes-core/uclibc/uclibc_git.bb
@@ -11,7 +11,7 @@ SRCREV="074930dd7f2a18a7013cdb72cc38136f3be39c40"
11PR_append = "+gitr${SRCPV}" 11PR_append = "+gitr${SRCPV}"
12 12
13require uclibc.inc 13require uclibc.inc
14PR = "${INC_PR}.0" 14PR = "${INC_PR}.1"
15PROVIDES += "virtual/${TARGET_PREFIX}libc-for-gcc" 15PROVIDES += "virtual/${TARGET_PREFIX}libc-for-gcc"
16 16
17#recent versions uclibc require real kernel headers 17#recent versions uclibc require real kernel headers
@@ -39,5 +39,6 @@ SRC_URI = "git://uclibc.org/uClibc.git;branch=master;protocol=git \
39 file://argp-support.patch \ 39 file://argp-support.patch \
40 file://argp-headers.patch \ 40 file://argp-headers.patch \
41 file://remove_attribute_optimize_Os.patch \ 41 file://remove_attribute_optimize_Os.patch \
42 file://uclibc-epoll.patch \
42 " 43 "
43S = "${WORKDIR}/git" 44S = "${WORKDIR}/git"