aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTimo Teräs <timo.teras@iki.fi>2010-06-12 12:48:02 +0300
committerTimo Teräs <timo.teras@iki.fi>2010-06-12 12:48:02 +0300
commite78111c2f02740a103083368c39df4bece60569f (patch)
tree879a7dfdede417a51ee8eb3e7b5f7b8548dbd138
parent53ae1813e99d25570f75e77b145d6825072ef838 (diff)
downloadalpine_aports-e78111c2f02740a103083368c39df4bece60569f.tar.bz2
alpine_aports-e78111c2f02740a103083368c39df4bece60569f.tar.xz
alpine_aports-e78111c2f02740a103083368c39df4bece60569f.zip
main/uclibc: define O_CLOEXEC in headers only
Allows applications using O_CLOEXEC to be compiled. No changes to uclibc library code.
-rw-r--r--main/uclibc/0010-define-O_CLOEXEC.patch295
-rw-r--r--main/uclibc/APKBUILD4
2 files changed, 298 insertions, 1 deletions
diff --git a/main/uclibc/0010-define-O_CLOEXEC.patch b/main/uclibc/0010-define-O_CLOEXEC.patch
new file mode 100644
index 0000000000..6db4dbbed0
--- /dev/null
+++ b/main/uclibc/0010-define-O_CLOEXEC.patch
@@ -0,0 +1,295 @@
1Backported from the below upstream commit by Timo Teräs. Changes
2to non-header files were removed.
3
4From b8f1f91cc6d7b579fdb2370ab046565f9930aa09 Mon Sep 17 00:00:00 2001
5From: Mike Frysinger <vapier@gentoo.org>
6Date: Wed, 7 Oct 2009 22:51:55 -0400
7Subject: [PATCH] clean up O_CLOEXEC handling
8
9Drop the "#ifndef O_CLOEXEC" cruft, enable O_CLOEXEC in most fcntl.h
10headers, and import __ASSUME_O_CLOEXEC from glibc.
11
12Signed-off-by: Mike Frysinger <vapier@gentoo.org>
13---
14 libc/misc/dirent/opendir.c | 8 +++-----
15 libc/misc/utmp/utent.c | 21 ++++-----------------
16 libc/pwd_grp/lckpwdf.c | 8 +++-----
17 libc/sysdeps/linux/alpha/bits/fcntl.h | 2 --
18 libc/sysdeps/linux/arm/bits/fcntl.h | 2 --
19 libc/sysdeps/linux/avr32/bits/fcntl.h | 1 +
20 libc/sysdeps/linux/bfin/bits/fcntl.h | 2 ++
21 libc/sysdeps/linux/common/bits/kernel-features.h | 8 ++++++++
22 libc/sysdeps/linux/cris/bits/fcntl.h | 1 +
23 libc/sysdeps/linux/frv/bits/fcntl.h | 2 ++
24 libc/sysdeps/linux/hppa/bits/fcntl.h | 1 +
25 libc/sysdeps/linux/i386/bits/fcntl.h | 2 --
26 libc/sysdeps/linux/ia64/bits/fcntl.h | 2 --
27 libc/sysdeps/linux/m68k/bits/fcntl.h | 1 +
28 libc/sysdeps/linux/microblaze/bits/fcntl.h | 2 ++
29 libc/sysdeps/linux/mips/bits/fcntl.h | 1 +
30 libc/sysdeps/linux/powerpc/bits/fcntl.h | 2 --
31 libc/sysdeps/linux/sh/bits/fcntl.h | 2 --
32 libc/sysdeps/linux/sh64/bits/fcntl.h | 2 ++
33 libc/sysdeps/linux/sparc/bits/fcntl.h | 2 --
34 libc/sysdeps/linux/x86_64/bits/fcntl.h | 2 --
35 libc/sysdeps/linux/xtensa/bits/fcntl.h | 1 +
36 22 files changed, 32 insertions(+), 43 deletions(-)
37
38diff --git a/libc/sysdeps/linux/alpha/bits/fcntl.h b/libc/sysdeps/linux/alpha/bits/fcntl.h
39index 2a6b9ea..649c563 100644
40--- a/libc/sysdeps/linux/alpha/bits/fcntl.h
41+++ b/libc/sysdeps/linux/alpha/bits/fcntl.h
42@@ -50,9 +50,7 @@
43 # define O_NOFOLLOW 0200000 /* Do not follow links. */
44 # define O_DIRECT 02000000 /* Direct disk access. */
45 # define O_NOATIME 04000000 /* Do not set atime. */
46-# if 0
47 # define O_CLOEXEC 010000000 /* Set close_on_exec. */
48-# endif
49 #endif
50
51 #ifdef __USE_LARGEFILE64
52diff --git a/libc/sysdeps/linux/arm/bits/fcntl.h b/libc/sysdeps/linux/arm/bits/fcntl.h
53index 86cea4b..7cc5a9d 100644
54--- a/libc/sysdeps/linux/arm/bits/fcntl.h
55+++ b/libc/sysdeps/linux/arm/bits/fcntl.h
56@@ -50,9 +50,7 @@
57 # define O_NOFOLLOW 0100000 /* Do not follow links. */
58 # define O_DIRECT 0200000 /* Direct disk access. */
59 # define O_NOATIME 01000000 /* Do not set atime. */
60-# if 0
61 # define O_CLOEXEC 02000000 /* Set close_on_exec. */
62-# endif
63 #endif
64
65 /* For now Linux has synchronisity options for data and read operations.
66diff --git a/libc/sysdeps/linux/avr32/bits/fcntl.h b/libc/sysdeps/linux/avr32/bits/fcntl.h
67index 2301e22..767243e 100644
68--- a/libc/sysdeps/linux/avr32/bits/fcntl.h
69+++ b/libc/sysdeps/linux/avr32/bits/fcntl.h
70@@ -30,6 +30,7 @@
71 # define O_DIRECTORY 00200000 /* direct disk access */
72 # define O_NOFOLLOW 00400000 /* don't follow links */
73 # define O_NOATIME 01000000 /* don't set atime */
74+# define O_CLOEXEC 02000000 /* set close_on_exec */
75 #endif
76
77 #ifdef __USE_LARGEFILE64
78diff --git a/libc/sysdeps/linux/bfin/bits/fcntl.h b/libc/sysdeps/linux/bfin/bits/fcntl.h
79index 7d0bcf9..f019b71 100644
80--- a/libc/sysdeps/linux/bfin/bits/fcntl.h
81+++ b/libc/sysdeps/linux/bfin/bits/fcntl.h
82@@ -48,6 +48,8 @@
83 # define O_DIRECTORY 040000 /* Must be a directory. */
84 # define O_NOFOLLOW 0100000 /* Do not follow links. */
85 # define O_DIRECT 0200000 /* Direct disk access. */
86+# define O_NOATIME 01000000 /* don't set atime */
87+# define O_CLOEXEC 02000000 /* set close_on_exec */
88 #endif
89
90 /* For now Linux has synchronisity options for data and read operations.
91diff --git a/libc/sysdeps/linux/common/bits/kernel-features.h b/libc/sysdeps/linux/common/bits/kernel-features.h
92index 5216d7b..8829734 100644
93--- a/libc/sysdeps/linux/common/bits/kernel-features.h
94+++ b/libc/sysdeps/linux/common/bits/kernel-features.h
95@@ -70,6 +70,14 @@
96 # define __ASSUME_GETDENTS32_D_TYPE 1
97 #endif
98
99+/* Support for various CLOEXEC and NONBLOCK flags was added for x86,
100+ x86-64, PPC, IA-64, SPARC< and S390 in 2.6.23. */
101+#if __LINUX_KERNEL_VERSION >= 0x020617 \
102+ && (defined __i386__ || defined __x86_64__ || defined __powerpc__ \
103+ || defined __ia64__ || defined __sparc__ || defined __s390__)
104+# define __ASSUME_O_CLOEXEC 1
105+#endif
106+
107 /* These features were surely available with 2.4.12. */
108 #if __LINUX_KERNEL_VERSION >= 132108 && defined __mc68000__
109 # define __ASSUME_MMAP2_SYSCALL 1
110diff --git a/libc/sysdeps/linux/cris/bits/fcntl.h b/libc/sysdeps/linux/cris/bits/fcntl.h
111index a2106ef..29443ba 100644
112--- a/libc/sysdeps/linux/cris/bits/fcntl.h
113+++ b/libc/sysdeps/linux/cris/bits/fcntl.h
114@@ -50,6 +50,7 @@
115 # define O_DIRECTORY 0200000 /* Must be a directory. */
116 # define O_NOFOLLOW 0400000 /* Do not follow links. */
117 # define O_NOATIME 01000000 /* Do not set atime. */
118+# define O_CLOEXEC 02000000 /* set close_on_exec */
119 #endif
120
121 /* For now Linux has synchronisity options for data and read operations.
122diff --git a/libc/sysdeps/linux/frv/bits/fcntl.h b/libc/sysdeps/linux/frv/bits/fcntl.h
123index 06e8860..d437175 100644
124--- a/libc/sysdeps/linux/frv/bits/fcntl.h
125+++ b/libc/sysdeps/linux/frv/bits/fcntl.h
126@@ -45,6 +45,8 @@
127 # define O_DIRECT 040000 /* Direct disk access. */
128 # define O_DIRECTORY 0200000 /* Must be a directory. */
129 # define O_NOFOLLOW 0400000 /* Do not follow links. */
130+# define O_NOATIME 01000000 /* don't set atime */
131+# define O_CLOEXEC 02000000 /* set close_on_exec */
132 #endif
133
134 /* For now Linux has synchronisity options for data and read operations.
135diff --git a/libc/sysdeps/linux/hppa/bits/fcntl.h b/libc/sysdeps/linux/hppa/bits/fcntl.h
136index cc23bf8..86e3b6f 100644
137--- a/libc/sysdeps/linux/hppa/bits/fcntl.h
138+++ b/libc/sysdeps/linux/hppa/bits/fcntl.h
139@@ -50,6 +50,7 @@
140 # define O_DIRECTORY 00010000 /* Must be a directory. */
141 # define O_NOFOLLOW 00000200 /* Do not follow links. */
142 # define O_NOATIME 04000000 /* Do not set atime. */
143+# define O_CLOEXEC 010000000 /* set close_on_exec */
144 #endif
145
146 #ifdef __USE_LARGEFILE64
147diff --git a/libc/sysdeps/linux/i386/bits/fcntl.h b/libc/sysdeps/linux/i386/bits/fcntl.h
148index 7f0b552..22e073b 100644
149--- a/libc/sysdeps/linux/i386/bits/fcntl.h
150+++ b/libc/sysdeps/linux/i386/bits/fcntl.h
151@@ -50,9 +50,7 @@
152 # define O_DIRECTORY 0200000 /* Must be a directory. */
153 # define O_NOFOLLOW 0400000 /* Do not follow links. */
154 # define O_NOATIME 01000000 /* Do not set atime. */
155-# if 0
156 # define O_CLOEXEC 02000000 /* Set close_on_exec. */
157-# endif
158 #endif
159
160 /* For now Linux has synchronisity options for data and read operations.
161diff --git a/libc/sysdeps/linux/ia64/bits/fcntl.h b/libc/sysdeps/linux/ia64/bits/fcntl.h
162index d134c4b..85a55f6 100644
163--- a/libc/sysdeps/linux/ia64/bits/fcntl.h
164+++ b/libc/sysdeps/linux/ia64/bits/fcntl.h
165@@ -49,9 +49,7 @@
166 # define O_DIRECTORY 0200000 /* must be a directory */
167 # define O_NOFOLLOW 0400000 /* don't follow links */
168 # define O_NOATIME 01000000 /* Do not set atime. */
169-# if 0
170 # define O_CLOEXEC 02000000 /* Set close_on_exec. */
171-# endif
172 #endif
173
174 #ifdef __USE_LARGEFILE64
175diff --git a/libc/sysdeps/linux/m68k/bits/fcntl.h b/libc/sysdeps/linux/m68k/bits/fcntl.h
176index d36198d..e564b42 100644
177--- a/libc/sysdeps/linux/m68k/bits/fcntl.h
178+++ b/libc/sysdeps/linux/m68k/bits/fcntl.h
179@@ -49,6 +49,7 @@
180 # define O_NOFOLLOW 0100000 /* Do not follow links. */
181 # define O_DIRECT 0200000 /* Direct disk access. */
182 # define O_NOATIME 01000000 /* Do not set atime. */
183+# define O_CLOEXEC 02000000 /* set close_on_exec */
184 #endif
185
186 /* For now Linux has synchronisity options for data and read operations.
187diff --git a/libc/sysdeps/linux/microblaze/bits/fcntl.h b/libc/sysdeps/linux/microblaze/bits/fcntl.h
188index c8aeb91..bb6727a 100644
189--- a/libc/sysdeps/linux/microblaze/bits/fcntl.h
190+++ b/libc/sysdeps/linux/microblaze/bits/fcntl.h
191@@ -45,6 +45,8 @@
192 # define O_DIRECTORY 040000 /* Must be a directory. */
193 # define O_NOFOLLOW 0100000 /* Do not follow links. */
194 # define O_DIRECT 0200000 /* Direct disk access. */
195+# define O_NOATIME 01000000 /* Do not set atime. */
196+# define O_CLOEXEC 02000000 /* set close_on_exec */
197 #endif
198
199 /* For now Linux has synchronisity options for data and read operations.
200diff --git a/libc/sysdeps/linux/mips/bits/fcntl.h b/libc/sysdeps/linux/mips/bits/fcntl.h
201index ef015a4..f0072fd 100644
202--- a/libc/sysdeps/linux/mips/bits/fcntl.h
203+++ b/libc/sysdeps/linux/mips/bits/fcntl.h
204@@ -51,6 +51,7 @@
205 # define O_DIRECT 0x8000 /* Direct disk access hint. */
206 # define O_DIRECTORY 0x10000 /* Must be a directory. */
207 # define O_NOATIME 0x40000 /* Do not set atime. */
208+# define O_CLOEXEC 02000000 /* set close_on_exec */
209 #endif
210
211 /* For now Linux has no synchronisity options for data and read operations.
212diff --git a/libc/sysdeps/linux/powerpc/bits/fcntl.h b/libc/sysdeps/linux/powerpc/bits/fcntl.h
213index ceb75b4..0759c6a 100644
214--- a/libc/sysdeps/linux/powerpc/bits/fcntl.h
215+++ b/libc/sysdeps/linux/powerpc/bits/fcntl.h
216@@ -50,9 +50,7 @@
217 # define O_DIRECTORY 040000 /* Must be a directory. */
218 # define O_NOFOLLOW 0100000 /* Do not follow links. */
219 # define O_NOATIME 01000000 /* Do not set atime. */
220-# if 0
221 # define O_CLOEXEC 02000000 /* Set close_on_exec. */
222-# endif
223 #endif
224
225 #ifdef __USE_LARGEFILE64
226diff --git a/libc/sysdeps/linux/sh/bits/fcntl.h b/libc/sysdeps/linux/sh/bits/fcntl.h
227index 570484c..adb7377 100644
228--- a/libc/sysdeps/linux/sh/bits/fcntl.h
229+++ b/libc/sysdeps/linux/sh/bits/fcntl.h
230@@ -50,9 +50,7 @@
231 # define O_DIRECTORY 0200000 /* Must be a directory. */
232 # define O_NOFOLLOW 0400000 /* Do not follow links. */
233 # define O_NOATIME 01000000 /* Do not set atime. */
234-# if 0
235 # define O_CLOEXEC 02000000 /* Set close_on_exec. */
236-# endif
237 #endif
238
239 /* For now Linux has synchronisity options for data and read operations.
240diff --git a/libc/sysdeps/linux/sh64/bits/fcntl.h b/libc/sysdeps/linux/sh64/bits/fcntl.h
241index 06e8860..156df97 100644
242--- a/libc/sysdeps/linux/sh64/bits/fcntl.h
243+++ b/libc/sysdeps/linux/sh64/bits/fcntl.h
244@@ -45,6 +45,8 @@
245 # define O_DIRECT 040000 /* Direct disk access. */
246 # define O_DIRECTORY 0200000 /* Must be a directory. */
247 # define O_NOFOLLOW 0400000 /* Do not follow links. */
248+# define O_NOATIME 01000000 /* Do not set atime. */
249+# define O_CLOEXEC 02000000 /* set close_on_exec */
250 #endif
251
252 /* For now Linux has synchronisity options for data and read operations.
253diff --git a/libc/sysdeps/linux/sparc/bits/fcntl.h b/libc/sysdeps/linux/sparc/bits/fcntl.h
254index 29c09a9..31a6d9b 100644
255--- a/libc/sysdeps/linux/sparc/bits/fcntl.h
256+++ b/libc/sysdeps/linux/sparc/bits/fcntl.h
257@@ -49,9 +49,7 @@
258 # define O_NOFOLLOW 0x20000 /* don't follow links */
259 # define O_DIRECT 0x100000 /* direct disk access hint */
260 # define O_NOATIME 0x200000 /* Do not set atime. */
261-# if 0
262 # define O_CLOEXEC 0x400000 /* Set close_on_exit. */
263-# endif
264 #endif
265
266 #ifdef __USE_LARGEFILE64
267diff --git a/libc/sysdeps/linux/x86_64/bits/fcntl.h b/libc/sysdeps/linux/x86_64/bits/fcntl.h
268index be00e4a..f1cf388 100644
269--- a/libc/sysdeps/linux/x86_64/bits/fcntl.h
270+++ b/libc/sysdeps/linux/x86_64/bits/fcntl.h
271@@ -50,9 +50,7 @@
272 # define O_DIRECTORY 0200000 /* Must be a directory. */
273 # define O_NOFOLLOW 0400000 /* Do not follow links. */
274 # define O_NOATIME 01000000 /* Do not set atime. */
275-# if 0
276 # define O_CLOEXEC 02000000 /* Set close_on_exec. */
277-# endif
278 #endif
279
280 /* For now Linux has synchronisity options for data and read operations.
281diff --git a/libc/sysdeps/linux/xtensa/bits/fcntl.h b/libc/sysdeps/linux/xtensa/bits/fcntl.h
282index a89362e..921a626 100644
283--- a/libc/sysdeps/linux/xtensa/bits/fcntl.h
284+++ b/libc/sysdeps/linux/xtensa/bits/fcntl.h
285@@ -50,6 +50,7 @@
286 # define O_DIRECTORY 0200000 /* Must be a directory. */
287 # define O_NOFOLLOW 0400000 /* Do not follow links. */
288 # define O_NOATIME 01000000 /* Do not set atime. */
289+# define O_CLOEXEC 02000000 /* set close_on_exec */
290 #endif
291
292 /* For now Linux has synchronisity options for data and read operations.
293--
2941.7.0.4
295
diff --git a/main/uclibc/APKBUILD b/main/uclibc/APKBUILD
index 72b5648b3b..7fc953d773 100644
--- a/main/uclibc/APKBUILD
+++ b/main/uclibc/APKBUILD
@@ -1,7 +1,7 @@
1# Maintainer: Natanael Copa <ncopa@alpinelinux.org> 1# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
2pkgname=uclibc 2pkgname=uclibc
3pkgver=0.9.30.2 3pkgver=0.9.30.2
4pkgrel=2 4pkgrel=3
5pkgdesc="C library for developing embedded Linux systems" 5pkgdesc="C library for developing embedded Linux systems"
6url=http://uclibc.org 6url=http://uclibc.org
7license="LGPL-2" 7license="LGPL-2"
@@ -25,6 +25,7 @@ source="http://uclibc.org/downloads/$_mynamever.tar.bz2
25 0007-Unbreak-build-for-sparc-on-some-config-s.patch 25 0007-Unbreak-build-for-sparc-on-some-config-s.patch
26 0008-malloc-fix-race-condition-and-other-bugs-in-the-no-m.patch 26 0008-malloc-fix-race-condition-and-other-bugs-in-the-no-m.patch
27 0009-libm-enable-log2f-and-exp2f.patch 27 0009-libm-enable-log2f-and-exp2f.patch
28 0010-define-O_CLOEXEC.patch
28 29
29 uclibc-linuxthreads-init-stdio.patch 30 uclibc-linuxthreads-init-stdio.patch
30 pthread-new-aliasing-fix.diff 31 pthread-new-aliasing-fix.diff
@@ -79,6 +80,7 @@ c78e19855a8a83f07855fe82ceaf9d21 0006-fstatat-fix-up-behavior-on-32-64-bit-host
79d20abc16e2ce8579f77e42271008ff07 0007-Unbreak-build-for-sparc-on-some-config-s.patch 80d20abc16e2ce8579f77e42271008ff07 0007-Unbreak-build-for-sparc-on-some-config-s.patch
802438e999b21cfaf823139df05d06dd33 0008-malloc-fix-race-condition-and-other-bugs-in-the-no-m.patch 812438e999b21cfaf823139df05d06dd33 0008-malloc-fix-race-condition-and-other-bugs-in-the-no-m.patch
810b2ed68cbd2e4bb2941155bdb1f0f9b0 0009-libm-enable-log2f-and-exp2f.patch 820b2ed68cbd2e4bb2941155bdb1f0f9b0 0009-libm-enable-log2f-and-exp2f.patch
8385b0c69f3810bd067efd709b5682b150 0010-define-O_CLOEXEC.patch
82152bd508303e110e660fa7935411b6df uclibc-linuxthreads-init-stdio.patch 84152bd508303e110e660fa7935411b6df uclibc-linuxthreads-init-stdio.patch
83969187e1da84d0a0a5957b392a3d5a2b pthread-new-aliasing-fix.diff 85969187e1da84d0a0a5957b392a3d5a2b pthread-new-aliasing-fix.diff
84bbb8475963e791f596c34c81ef5583d7 uclibc-resolv-cname-fix.diff 86bbb8475963e791f596c34c81ef5583d7 uclibc-resolv-cname-fix.diff