1 |
commit: ded80d978dfbf73f3fd325658a565e3e9ce00f95 |
2 |
Author: Anthony G. Basile <blueness <AT> gentoo <DOT> org> |
3 |
AuthorDate: Sun May 26 13:42:20 2013 +0000 |
4 |
Commit: Anthony G. Basile <blueness <AT> gentoo <DOT> org> |
5 |
CommitDate: Sun May 26 13:42:20 2013 +0000 |
6 |
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/releng.git;a=commit;h=ded80d97 |
7 |
|
8 |
tools-uclibc: bump mips to gcc-4.8.0 and uclibc-0.9.33.2-r4 |
9 |
|
10 |
--- |
11 |
.../package.accept_keywords/gcc | 2 +- |
12 |
.../portage.mips32r2.hardened/package.mask/python | 1 + |
13 |
.../portage.mips32r2.hardened/package.unmask/gcc | 1 + |
14 |
.../sys-libs/uclibc/01_add-posix_fallocate.patch | 321 -------------------- |
15 |
.../{uclibc-0.9.33.2-r3 => uclibc-0.9.33.2-r4} | 0 |
16 |
.../package.accept_keywords/gcc | 2 +- |
17 |
.../portage.mips32r2.vanilla/package.mask/python | 1 + |
18 |
.../portage.mips32r2.vanilla/package.unmask/gcc | 1 + |
19 |
.../sys-libs/uclibc/01_add-posix_fallocate.patch | 321 -------------------- |
20 |
.../{uclibc-0.9.33.2-r3 => uclibc-0.9.33.2-r4} | 0 |
21 |
.../package.accept_keywords/gcc | 2 +- |
22 |
.../portage.mipsel3.hardened/package.mask/python | 1 + |
23 |
.../portage.mipsel3.hardened/package.unmask/gcc | 1 + |
24 |
.../sys-libs/uclibc/01_add-posix_fallocate.patch | 321 -------------------- |
25 |
.../{uclibc-0.9.33.2-r3 => uclibc-0.9.33.2-r4} | 0 |
26 |
.../package.accept_keywords/gcc | 2 +- |
27 |
.../portage.mipsel3.vanilla/package.mask/python | 1 + |
28 |
.../portage.mipsel3.vanilla/package.unmask/gcc | 1 + |
29 |
.../sys-libs/uclibc/01_add-posix_fallocate.patch | 321 -------------------- |
30 |
.../{uclibc-0.9.33.2-r3 => uclibc-0.9.33.2-r4} | 0 |
31 |
20 files changed, 12 insertions(+), 1288 deletions(-) |
32 |
|
33 |
diff --git a/tools-uclibc/portage.mips32r2.hardened/package.accept_keywords/gcc b/tools-uclibc/portage.mips32r2.hardened/package.accept_keywords/gcc |
34 |
index 18235b7..e48c4b7 100644 |
35 |
--- a/tools-uclibc/portage.mips32r2.hardened/package.accept_keywords/gcc |
36 |
+++ b/tools-uclibc/portage.mips32r2.hardened/package.accept_keywords/gcc |
37 |
@@ -1 +1 @@ |
38 |
-=sys-devel/gcc-4.6.3-r99 ~mips |
39 |
+=sys-devel/gcc-4.8.0 ** |
40 |
|
41 |
diff --git a/tools-uclibc/portage.mips32r2.hardened/package.mask/python b/tools-uclibc/portage.mips32r2.hardened/package.mask/python |
42 |
new file mode 100644 |
43 |
index 0000000..72c698b |
44 |
--- /dev/null |
45 |
+++ b/tools-uclibc/portage.mips32r2.hardened/package.mask/python |
46 |
@@ -0,0 +1 @@ |
47 |
+=dev-lang/python-2.7.4* |
48 |
|
49 |
diff --git a/tools-uclibc/portage.mips32r2.hardened/package.unmask/gcc b/tools-uclibc/portage.mips32r2.hardened/package.unmask/gcc |
50 |
new file mode 100644 |
51 |
index 0000000..ccc13f2 |
52 |
--- /dev/null |
53 |
+++ b/tools-uclibc/portage.mips32r2.hardened/package.unmask/gcc |
54 |
@@ -0,0 +1 @@ |
55 |
+=sys-devel/gcc-4.8.0 |
56 |
|
57 |
diff --git a/tools-uclibc/portage.mips32r2.hardened/patches/sys-libs/uclibc/01_add-posix_fallocate.patch b/tools-uclibc/portage.mips32r2.hardened/patches/sys-libs/uclibc/01_add-posix_fallocate.patch |
58 |
deleted file mode 100644 |
59 |
index dc7bbd7..0000000 |
60 |
--- a/tools-uclibc/portage.mips32r2.hardened/patches/sys-libs/uclibc/01_add-posix_fallocate.patch |
61 |
+++ /dev/null |
62 |
@@ -1,321 +0,0 @@ |
63 |
-From 5643900913f64c00f1c2958914586708efa5a473 Mon Sep 17 00:00:00 2001 |
64 |
-From: Bernhard Reutner-Fischer <rep.dot.nop@×××××.com> |
65 |
-Date: Tue, 17 Apr 2012 07:30:15 +0000 |
66 |
-Subject: libc: add posix_fallocate() |
67 |
- |
68 |
-Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@×××××.com> |
69 |
---- |
70 |
-diff --git a/include/fcntl.h b/include/fcntl.h |
71 |
-index ed009dd..c749ad5 100644 |
72 |
---- a/include/fcntl.h |
73 |
-+++ b/include/fcntl.h |
74 |
-@@ -217,9 +217,7 @@ extern int posix_fadvise64 (int __fd, __off64_t __offset, __off64_t __len, |
75 |
- |
76 |
- #endif |
77 |
- |
78 |
--#if 0 /* && defined __UCLIBC_HAS_ADVANCED_REALTIME__ */ |
79 |
-- |
80 |
--/* FIXME -- uClibc should probably implement these... */ |
81 |
-+#if defined __UCLIBC_HAS_ADVANCED_REALTIME__ |
82 |
- |
83 |
- /* Reserve storage for the data of the file associated with FD. |
84 |
- |
85 |
-diff --git a/libc/sysdeps/linux/common/Makefile.in b/libc/sysdeps/linux/common/Makefile.in |
86 |
-index 566722d..29566dd 100644 |
87 |
---- a/libc/sysdeps/linux/common/Makefile.in |
88 |
-+++ b/libc/sysdeps/linux/common/Makefile.in |
89 |
-@@ -82,7 +82,8 @@ CSRC-$(UCLIBC_HAS_REALTIME) += clock_getres.c clock_gettime.c clock_settime.c \ |
90 |
- sched_get_priority_max.c sched_get_priority_min.c sched_getscheduler.c \ |
91 |
- sched_rr_get_interval.c sched_setparam.c sched_setscheduler.c sigqueue.c |
92 |
- # clock_getcpuclockid|clock_nanosleep|mq_timedreceive|mq_timedsend|posix_fadvise|posix_fallocate|posix_madvise|posix_memalign|posix_mem_offset|posix_spawnattr_destroy|posix_spawnattr_init|posix_spawnattr_getflags|posix_spawnattr_setflags|posix_spawnattr_getpgroup|posix_spawnattr_setpgroup|posix_spawnattr_getschedparam|posix_spawnattr_setschedparam|posix_spawnattr_getschedpolicy|posix_spawnattr_setschedpolicy|posix_spawnattr_getsigdefault|posix_spawnattr_setsigdefault|posix_spawnattr_getsigmask|posix_spawnattr_setsigmask|posix_spawnattr_init|posix_spawnattr_setflags|posix_spawnattr_setpgroup|posix_spawnattr_setschedparam|posix_spawnattr_setschedpolicy|posix_spawnattr_setsigdefault|posix_spawnattr_setsigmask|posix_spawn_file_actions_addclose|posix_spawn_file_actions_addopen|posix_spawn_file_actions_adddup2|posix_spawn_file_actions_addopen|posix_spawn_file_actions_destroy|posix_spawn_file_actions_init|posix_spawn_file_actions_init|posix_spawn|posix_spawnp|posix_spawnp|posix_typed_mem_ |
93 |
get_info|pthread_mutex_timedlock|sem_timedwait |
94 |
--CSRC-$(UCLIBC_HAS_ADVANCED_REALTIME) += posix_fadvise64.c posix_fadvise.c posix_madvise.c |
95 |
-+CSRC-$(UCLIBC_HAS_ADVANCED_REALTIME) += posix_fadvise64.c posix_fadvise.c posix_madvise.c \ |
96 |
-+ posix_fallocate.c posix_fallocate64.c |
97 |
- CSRC-$(UCLIBC_SUSV4_LEGACY) += utime.c |
98 |
- CSRC-$(UCLIBC_HAS_EPOLL) += epoll.c |
99 |
- CSRC-$(UCLIBC_HAS_XATTR) += xattr.c |
100 |
-diff --git a/libc/sysdeps/linux/common/bits/kernel-features.h b/libc/sysdeps/linux/common/bits/kernel-features.h |
101 |
-index 4d1e0cb..6184c2b 100644 |
102 |
---- a/libc/sysdeps/linux/common/bits/kernel-features.h |
103 |
-+++ b/libc/sysdeps/linux/common/bits/kernel-features.h |
104 |
-@@ -495,6 +495,14 @@ |
105 |
- # define __ASSUME_PRIVATE_FUTEX 1 |
106 |
- #endif |
107 |
- |
108 |
-+/* Support for fallocate was added in 2.6.23, |
109 |
-+ on s390 only after 2.6.23-rc1, on alpha only after 2.6.33-rc1. */ |
110 |
-+#if __LINUX_KERNEL_VERSION >= 0x020617 \ |
111 |
-+ && (!defined __s390__ || __LINUX_KERNEL_VERSION >= 0x020618) \ |
112 |
-+ && (!defined __alpha__ || __LINUX_KERNEL_VERSION >= 0x020621) |
113 |
-+# define __ASSUME_FALLOCATE 1 |
114 |
-+#endif |
115 |
-+ |
116 |
- /* getcpu is a syscall for x86-64 since 3.1. */ |
117 |
- #if defined __x86_64__ && __LINUX_KERNEL_VERSION >= 0x030100 |
118 |
- # define __ASSUME_GETCPU_SYSCALL 1 |
119 |
-diff --git a/libc/sysdeps/linux/common/posix_fallocate.c b/libc/sysdeps/linux/common/posix_fallocate.c |
120 |
-new file mode 100644 |
121 |
-index 0000000..9aaa6ce |
122 |
---- /dev/null |
123 |
-+++ b/libc/sysdeps/linux/common/posix_fallocate.c |
124 |
-@@ -0,0 +1,43 @@ |
125 |
-+/* vi: set sw=4 ts=4: */ |
126 |
-+/* |
127 |
-+ * posix_fallocate() for uClibc |
128 |
-+ * http://www.opengroup.org/onlinepubs/9699919799/functions/posix_fallocate.html |
129 |
-+ * |
130 |
-+ * Copyright (C) 2000-2006 Erik Andersen <andersen@××××××.org> |
131 |
-+ * |
132 |
-+ * Licensed under the LGPL v2.1 or later, see the file COPYING.LIB in this tarball. |
133 |
-+ */ |
134 |
-+ |
135 |
-+#include <sys/syscall.h> |
136 |
-+#include <fcntl.h> |
137 |
-+#include <bits/kernel-features.h> |
138 |
-+#include <stdint.h> |
139 |
-+ |
140 |
-+#if defined __NR_fallocate |
141 |
-+int posix_fallocate(int fd, __off_t offset, __off_t len) |
142 |
-+{ |
143 |
-+ int ret; |
144 |
-+ |
145 |
-+# if __WORDSIZE == 32 |
146 |
-+ uint32_t off_low = offset; |
147 |
-+ uint32_t len_low = len; |
148 |
-+ /* may assert that these >>31 are 0 */ |
149 |
-+ uint32_t zero = 0; |
150 |
-+ INTERNAL_SYSCALL_DECL(err); |
151 |
-+ ret = (int) (INTERNAL_SYSCALL(fallocate, err, 6, fd, 0, |
152 |
-+ __LONG_LONG_PAIR (zero, off_low), |
153 |
-+ __LONG_LONG_PAIR (zero, len_low))); |
154 |
-+# elif __WORDSIZE == 64 |
155 |
-+ INTERNAL_SYSCALL_DECL(err); |
156 |
-+ ret = (int) (INTERNAL_SYSCALL(fallocate, err, 4, fd, 0, offset, len)); |
157 |
-+# else |
158 |
-+# error your machine is neither 32 bit or 64 bit ... it must be magical |
159 |
-+#endif |
160 |
-+ if (unlikely(INTERNAL_SYSCALL_ERROR_P (ret, err))) |
161 |
-+ return INTERNAL_SYSCALL_ERRNO (ret, err); |
162 |
-+ return 0; |
163 |
-+} |
164 |
-+# if defined __UCLIBC_HAS_LFS__ && __WORDSIZE == 64 |
165 |
-+strong_alias(posix_fallocate,posix_fallocate64) |
166 |
-+# endif |
167 |
-+#endif |
168 |
-diff --git a/libc/sysdeps/linux/common/posix_fallocate64.c b/libc/sysdeps/linux/common/posix_fallocate64.c |
169 |
-new file mode 100644 |
170 |
-index 0000000..818d868 |
171 |
---- /dev/null |
172 |
-+++ b/libc/sysdeps/linux/common/posix_fallocate64.c |
173 |
-@@ -0,0 +1,39 @@ |
174 |
-+/* vi: set sw=4 ts=4: */ |
175 |
-+/* |
176 |
-+ * posix_fallocate() for uClibc |
177 |
-+ * http://www.opengroup.org/onlinepubs/9699919799/functions/posix_fallocate.html |
178 |
-+ * |
179 |
-+ * Copyright (C) 2000-2006 Erik Andersen <andersen@××××××.org> |
180 |
-+ * |
181 |
-+ * Licensed under the LGPL v2.1 or later, see the file COPYING.LIB in this tarball. |
182 |
-+ */ |
183 |
-+ |
184 |
-+#include <sys/syscall.h> |
185 |
-+#include <fcntl.h> |
186 |
-+#include <bits/kernel-features.h> |
187 |
-+#include <stdint.h> |
188 |
-+ |
189 |
-+#if defined __NR_fallocate |
190 |
-+ |
191 |
-+# if __WORDSIZE == 64 |
192 |
-+/* Can use normal posix_fallocate() */ |
193 |
-+# elif __WORDSIZE == 32 |
194 |
-+int posix_fallocate64(int fd, __off64_t offset, __off64_t len) |
195 |
-+{ |
196 |
-+ int ret; |
197 |
-+ uint32_t off_low = offset & 0xffffffff; |
198 |
-+ uint32_t off_high = offset >> 32; |
199 |
-+ uint32_t len_low = len & 0xffffffff; |
200 |
-+ uint32_t len_high = len >> 32; |
201 |
-+ INTERNAL_SYSCALL_DECL(err); |
202 |
-+ ret = (int) (INTERNAL_SYSCALL(fallocate, err, 6, fd, 0, |
203 |
-+ __LONG_LONG_PAIR (off_high, off_low), |
204 |
-+ __LONG_LONG_PAIR (len_high, len_low))); |
205 |
-+ if (unlikely(INTERNAL_SYSCALL_ERROR_P (ret, err))) |
206 |
-+ return INTERNAL_SYSCALL_ERRNO (ret, err); |
207 |
-+ return 0; |
208 |
-+} |
209 |
-+# else |
210 |
-+# error your machine is neither 32 bit or 64 bit ... it must be magical |
211 |
-+# endif |
212 |
-+#endif |
213 |
-diff --git a/test/.gitignore b/test/.gitignore |
214 |
-index c068f89..ec04628 100644 |
215 |
---- a/test/.gitignore |
216 |
-+++ b/test/.gitignore |
217 |
-@@ -319,6 +319,8 @@ unistd/getcwd |
218 |
- unistd/getopt |
219 |
- unistd/getopt_long |
220 |
- unistd/tstgetopt |
221 |
-+unistd/tst-posix_fallocate |
222 |
-+unistd/tst-posix_fallocate64 |
223 |
- unistd/tst-preadwrite |
224 |
- unistd/tst-preadwrite64 |
225 |
- unistd/vfork |
226 |
-diff --git a/test/unistd/Makefile.in b/test/unistd/Makefile.in |
227 |
-index c542f98..24b9a37 100644 |
228 |
---- a/test/unistd/Makefile.in |
229 |
-+++ b/test/unistd/Makefile.in |
230 |
-@@ -2,7 +2,10 @@ |
231 |
- # Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball. |
232 |
- |
233 |
- ifeq ($(UCLIBC_HAS_LFS),) |
234 |
--TESTS_DISABLED := tst-preadwrite64 |
235 |
-+TESTS_DISABLED := tst-preadwrite64 tst-posix_fallocate64 |
236 |
-+endif |
237 |
-+ifeq ($(UCLIBC_HAS_ADVANCED_REALTIME),) |
238 |
-+TESTS_DISABLED := tst-posix_fallocate |
239 |
- endif |
240 |
- OPTS_getopt := -abcXXX -9 |
241 |
- OPTS_getopt_long := --add XXX --delete YYY --verbose |
242 |
-diff --git a/test/unistd/tst-posix_fallocate.c b/test/unistd/tst-posix_fallocate.c |
243 |
-new file mode 100644 |
244 |
-index 0000000..d41c604 |
245 |
---- /dev/null |
246 |
-+++ b/test/unistd/tst-posix_fallocate.c |
247 |
-@@ -0,0 +1,127 @@ |
248 |
-+#include <fcntl.h> |
249 |
-+#include <sys/stat.h> |
250 |
-+ |
251 |
-+#ifndef TST_POSIX_FALLOCATE64 |
252 |
-+# define stat64 stat |
253 |
-+# define fstat64 fstat |
254 |
-+# else |
255 |
-+# ifndef O_LARGEFILE |
256 |
-+# error no O_LARGEFILE but you want to test with LFS enabled |
257 |
-+# endif |
258 |
-+#endif |
259 |
-+ |
260 |
-+static void do_prepare (void); |
261 |
-+#define PREPARE(argc, argv) do_prepare () |
262 |
-+static int do_test (void); |
263 |
-+#define TEST_FUNCTION do_test () |
264 |
-+#include <test-skeleton.c> |
265 |
-+ |
266 |
-+static int fd; |
267 |
-+static void |
268 |
-+do_prepare (void) |
269 |
-+{ |
270 |
-+ fd = create_temp_file ("tst-posix_fallocate.", NULL); |
271 |
-+ if (fd == -1) |
272 |
-+ { |
273 |
-+ printf ("cannot create temporary file: %m\n"); |
274 |
-+ exit (1); |
275 |
-+ } |
276 |
-+} |
277 |
-+ |
278 |
-+ |
279 |
-+static int |
280 |
-+do_test (void) |
281 |
-+{ |
282 |
-+ struct stat64 st; |
283 |
-+ |
284 |
-+ if (fstat64 (fd, &st) != 0) |
285 |
-+ { |
286 |
-+ puts ("1st fstat failed"); |
287 |
-+ return 1; |
288 |
-+ } |
289 |
-+ |
290 |
-+ if (st.st_size != 0) |
291 |
-+ { |
292 |
-+ puts ("file not created with size 0"); |
293 |
-+ return 1; |
294 |
-+ } |
295 |
-+ |
296 |
-+ if (posix_fallocate (fd, 512, 768) != 0) |
297 |
-+ { |
298 |
-+ puts ("1st posix_fallocate call failed"); |
299 |
-+ return 1; |
300 |
-+ } |
301 |
-+ |
302 |
-+ if (fstat64 (fd, &st) != 0) |
303 |
-+ { |
304 |
-+ puts ("2nd fstat failed"); |
305 |
-+ return 1; |
306 |
-+ } |
307 |
-+ |
308 |
-+ if (st.st_size != 512 + 768) |
309 |
-+ { |
310 |
-+ printf ("file size after 1st posix_fallocate call is %llu, expected %u\n", |
311 |
-+ (unsigned long long int) st.st_size, 512u + 768u); |
312 |
-+ return 1; |
313 |
-+ } |
314 |
-+ |
315 |
-+ if (posix_fallocate (fd, 0, 1024) != 0) |
316 |
-+ { |
317 |
-+ puts ("2nd posix_fallocate call failed"); |
318 |
-+ return 1; |
319 |
-+ } |
320 |
-+ |
321 |
-+ if (fstat64 (fd, &st) != 0) |
322 |
-+ { |
323 |
-+ puts ("3rd fstat failed"); |
324 |
-+ return 1; |
325 |
-+ } |
326 |
-+ |
327 |
-+ if (st.st_size != 512 + 768) |
328 |
-+ { |
329 |
-+ puts ("file size changed in 2nd posix_fallocate"); |
330 |
-+ return 1; |
331 |
-+ } |
332 |
-+ |
333 |
-+ if (posix_fallocate (fd, 2048, 64) != 0) |
334 |
-+ { |
335 |
-+ puts ("3rd posix_fallocate call failed"); |
336 |
-+ return 1; |
337 |
-+ } |
338 |
-+ |
339 |
-+ if (fstat64 (fd, &st) != 0) |
340 |
-+ { |
341 |
-+ puts ("4th fstat failed"); |
342 |
-+ return 1; |
343 |
-+ } |
344 |
-+ |
345 |
-+ if (st.st_size != 2048 + 64) |
346 |
-+ { |
347 |
-+ printf ("file size after 3rd posix_fallocate call is %llu, expected %u\n", |
348 |
-+ (unsigned long long int) st.st_size, 2048u + 64u); |
349 |
-+ return 1; |
350 |
-+ } |
351 |
-+#ifdef TST_POSIX_FALLOCATE64 |
352 |
-+ if (posix_fallocate64 (fd, 4097ULL, 4294967295ULL + 2ULL) != 0) |
353 |
-+ { |
354 |
-+ puts ("4th posix_fallocate call failed"); |
355 |
-+ return 1; |
356 |
-+ } |
357 |
-+ |
358 |
-+ if (fstat64 (fd, &st) != 0) |
359 |
-+ { |
360 |
-+ puts ("5th fstat failed"); |
361 |
-+ return 1; |
362 |
-+ } |
363 |
-+ |
364 |
-+ if (st.st_size != 4097ULL + 4294967295ULL + 2ULL) |
365 |
-+ { |
366 |
-+ printf ("file size after 4th posix_fallocate call is %llu, expected %llu\n", |
367 |
-+ (unsigned long long int) st.st_size, 4097ULL + 4294967295ULL + 2ULL); |
368 |
-+ return 1; |
369 |
-+ } |
370 |
-+#endif |
371 |
-+ close (fd); |
372 |
-+ |
373 |
-+ return 0; |
374 |
-+} |
375 |
-diff --git a/test/unistd/tst-posix_fallocate64.c b/test/unistd/tst-posix_fallocate64.c |
376 |
-new file mode 100644 |
377 |
-index 0000000..b1ee0ff |
378 |
---- /dev/null |
379 |
-+++ b/test/unistd/tst-posix_fallocate64.c |
380 |
-@@ -0,0 +1,2 @@ |
381 |
-+#define TST_POSIX_FALLOCATE64 |
382 |
-+#include "tst-posix_fallocate.c" |
383 |
--- |
384 |
-cgit v0.9.1 |
385 |
|
386 |
diff --git a/tools-uclibc/portage.mips32r2.hardened/savedconfig/sys-libs/uclibc-0.9.33.2-r3 b/tools-uclibc/portage.mips32r2.hardened/savedconfig/sys-libs/uclibc-0.9.33.2-r4 |
387 |
similarity index 100% |
388 |
rename from tools-uclibc/portage.mips32r2.hardened/savedconfig/sys-libs/uclibc-0.9.33.2-r3 |
389 |
rename to tools-uclibc/portage.mips32r2.hardened/savedconfig/sys-libs/uclibc-0.9.33.2-r4 |
390 |
|
391 |
diff --git a/tools-uclibc/portage.mips32r2.vanilla/package.accept_keywords/gcc b/tools-uclibc/portage.mips32r2.vanilla/package.accept_keywords/gcc |
392 |
index 18235b7..e48c4b7 100644 |
393 |
--- a/tools-uclibc/portage.mips32r2.vanilla/package.accept_keywords/gcc |
394 |
+++ b/tools-uclibc/portage.mips32r2.vanilla/package.accept_keywords/gcc |
395 |
@@ -1 +1 @@ |
396 |
-=sys-devel/gcc-4.6.3-r99 ~mips |
397 |
+=sys-devel/gcc-4.8.0 ** |
398 |
|
399 |
diff --git a/tools-uclibc/portage.mips32r2.vanilla/package.mask/python b/tools-uclibc/portage.mips32r2.vanilla/package.mask/python |
400 |
new file mode 100644 |
401 |
index 0000000..72c698b |
402 |
--- /dev/null |
403 |
+++ b/tools-uclibc/portage.mips32r2.vanilla/package.mask/python |
404 |
@@ -0,0 +1 @@ |
405 |
+=dev-lang/python-2.7.4* |
406 |
|
407 |
diff --git a/tools-uclibc/portage.mips32r2.vanilla/package.unmask/gcc b/tools-uclibc/portage.mips32r2.vanilla/package.unmask/gcc |
408 |
new file mode 100644 |
409 |
index 0000000..ccc13f2 |
410 |
--- /dev/null |
411 |
+++ b/tools-uclibc/portage.mips32r2.vanilla/package.unmask/gcc |
412 |
@@ -0,0 +1 @@ |
413 |
+=sys-devel/gcc-4.8.0 |
414 |
|
415 |
diff --git a/tools-uclibc/portage.mips32r2.vanilla/patches/sys-libs/uclibc/01_add-posix_fallocate.patch b/tools-uclibc/portage.mips32r2.vanilla/patches/sys-libs/uclibc/01_add-posix_fallocate.patch |
416 |
deleted file mode 100644 |
417 |
index dc7bbd7..0000000 |
418 |
--- a/tools-uclibc/portage.mips32r2.vanilla/patches/sys-libs/uclibc/01_add-posix_fallocate.patch |
419 |
+++ /dev/null |
420 |
@@ -1,321 +0,0 @@ |
421 |
-From 5643900913f64c00f1c2958914586708efa5a473 Mon Sep 17 00:00:00 2001 |
422 |
-From: Bernhard Reutner-Fischer <rep.dot.nop@×××××.com> |
423 |
-Date: Tue, 17 Apr 2012 07:30:15 +0000 |
424 |
-Subject: libc: add posix_fallocate() |
425 |
- |
426 |
-Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@×××××.com> |
427 |
---- |
428 |
-diff --git a/include/fcntl.h b/include/fcntl.h |
429 |
-index ed009dd..c749ad5 100644 |
430 |
---- a/include/fcntl.h |
431 |
-+++ b/include/fcntl.h |
432 |
-@@ -217,9 +217,7 @@ extern int posix_fadvise64 (int __fd, __off64_t __offset, __off64_t __len, |
433 |
- |
434 |
- #endif |
435 |
- |
436 |
--#if 0 /* && defined __UCLIBC_HAS_ADVANCED_REALTIME__ */ |
437 |
-- |
438 |
--/* FIXME -- uClibc should probably implement these... */ |
439 |
-+#if defined __UCLIBC_HAS_ADVANCED_REALTIME__ |
440 |
- |
441 |
- /* Reserve storage for the data of the file associated with FD. |
442 |
- |
443 |
-diff --git a/libc/sysdeps/linux/common/Makefile.in b/libc/sysdeps/linux/common/Makefile.in |
444 |
-index 566722d..29566dd 100644 |
445 |
---- a/libc/sysdeps/linux/common/Makefile.in |
446 |
-+++ b/libc/sysdeps/linux/common/Makefile.in |
447 |
-@@ -82,7 +82,8 @@ CSRC-$(UCLIBC_HAS_REALTIME) += clock_getres.c clock_gettime.c clock_settime.c \ |
448 |
- sched_get_priority_max.c sched_get_priority_min.c sched_getscheduler.c \ |
449 |
- sched_rr_get_interval.c sched_setparam.c sched_setscheduler.c sigqueue.c |
450 |
- # clock_getcpuclockid|clock_nanosleep|mq_timedreceive|mq_timedsend|posix_fadvise|posix_fallocate|posix_madvise|posix_memalign|posix_mem_offset|posix_spawnattr_destroy|posix_spawnattr_init|posix_spawnattr_getflags|posix_spawnattr_setflags|posix_spawnattr_getpgroup|posix_spawnattr_setpgroup|posix_spawnattr_getschedparam|posix_spawnattr_setschedparam|posix_spawnattr_getschedpolicy|posix_spawnattr_setschedpolicy|posix_spawnattr_getsigdefault|posix_spawnattr_setsigdefault|posix_spawnattr_getsigmask|posix_spawnattr_setsigmask|posix_spawnattr_init|posix_spawnattr_setflags|posix_spawnattr_setpgroup|posix_spawnattr_setschedparam|posix_spawnattr_setschedpolicy|posix_spawnattr_setsigdefault|posix_spawnattr_setsigmask|posix_spawn_file_actions_addclose|posix_spawn_file_actions_addopen|posix_spawn_file_actions_adddup2|posix_spawn_file_actions_addopen|posix_spawn_file_actions_destroy|posix_spawn_file_actions_init|posix_spawn_file_actions_init|posix_spawn|posix_spawnp|posix_spawnp|posix_typed_mem_ |
451 |
get_info|pthread_mutex_timedlock|sem_timedwait |
452 |
--CSRC-$(UCLIBC_HAS_ADVANCED_REALTIME) += posix_fadvise64.c posix_fadvise.c posix_madvise.c |
453 |
-+CSRC-$(UCLIBC_HAS_ADVANCED_REALTIME) += posix_fadvise64.c posix_fadvise.c posix_madvise.c \ |
454 |
-+ posix_fallocate.c posix_fallocate64.c |
455 |
- CSRC-$(UCLIBC_SUSV4_LEGACY) += utime.c |
456 |
- CSRC-$(UCLIBC_HAS_EPOLL) += epoll.c |
457 |
- CSRC-$(UCLIBC_HAS_XATTR) += xattr.c |
458 |
-diff --git a/libc/sysdeps/linux/common/bits/kernel-features.h b/libc/sysdeps/linux/common/bits/kernel-features.h |
459 |
-index 4d1e0cb..6184c2b 100644 |
460 |
---- a/libc/sysdeps/linux/common/bits/kernel-features.h |
461 |
-+++ b/libc/sysdeps/linux/common/bits/kernel-features.h |
462 |
-@@ -495,6 +495,14 @@ |
463 |
- # define __ASSUME_PRIVATE_FUTEX 1 |
464 |
- #endif |
465 |
- |
466 |
-+/* Support for fallocate was added in 2.6.23, |
467 |
-+ on s390 only after 2.6.23-rc1, on alpha only after 2.6.33-rc1. */ |
468 |
-+#if __LINUX_KERNEL_VERSION >= 0x020617 \ |
469 |
-+ && (!defined __s390__ || __LINUX_KERNEL_VERSION >= 0x020618) \ |
470 |
-+ && (!defined __alpha__ || __LINUX_KERNEL_VERSION >= 0x020621) |
471 |
-+# define __ASSUME_FALLOCATE 1 |
472 |
-+#endif |
473 |
-+ |
474 |
- /* getcpu is a syscall for x86-64 since 3.1. */ |
475 |
- #if defined __x86_64__ && __LINUX_KERNEL_VERSION >= 0x030100 |
476 |
- # define __ASSUME_GETCPU_SYSCALL 1 |
477 |
-diff --git a/libc/sysdeps/linux/common/posix_fallocate.c b/libc/sysdeps/linux/common/posix_fallocate.c |
478 |
-new file mode 100644 |
479 |
-index 0000000..9aaa6ce |
480 |
---- /dev/null |
481 |
-+++ b/libc/sysdeps/linux/common/posix_fallocate.c |
482 |
-@@ -0,0 +1,43 @@ |
483 |
-+/* vi: set sw=4 ts=4: */ |
484 |
-+/* |
485 |
-+ * posix_fallocate() for uClibc |
486 |
-+ * http://www.opengroup.org/onlinepubs/9699919799/functions/posix_fallocate.html |
487 |
-+ * |
488 |
-+ * Copyright (C) 2000-2006 Erik Andersen <andersen@××××××.org> |
489 |
-+ * |
490 |
-+ * Licensed under the LGPL v2.1 or later, see the file COPYING.LIB in this tarball. |
491 |
-+ */ |
492 |
-+ |
493 |
-+#include <sys/syscall.h> |
494 |
-+#include <fcntl.h> |
495 |
-+#include <bits/kernel-features.h> |
496 |
-+#include <stdint.h> |
497 |
-+ |
498 |
-+#if defined __NR_fallocate |
499 |
-+int posix_fallocate(int fd, __off_t offset, __off_t len) |
500 |
-+{ |
501 |
-+ int ret; |
502 |
-+ |
503 |
-+# if __WORDSIZE == 32 |
504 |
-+ uint32_t off_low = offset; |
505 |
-+ uint32_t len_low = len; |
506 |
-+ /* may assert that these >>31 are 0 */ |
507 |
-+ uint32_t zero = 0; |
508 |
-+ INTERNAL_SYSCALL_DECL(err); |
509 |
-+ ret = (int) (INTERNAL_SYSCALL(fallocate, err, 6, fd, 0, |
510 |
-+ __LONG_LONG_PAIR (zero, off_low), |
511 |
-+ __LONG_LONG_PAIR (zero, len_low))); |
512 |
-+# elif __WORDSIZE == 64 |
513 |
-+ INTERNAL_SYSCALL_DECL(err); |
514 |
-+ ret = (int) (INTERNAL_SYSCALL(fallocate, err, 4, fd, 0, offset, len)); |
515 |
-+# else |
516 |
-+# error your machine is neither 32 bit or 64 bit ... it must be magical |
517 |
-+#endif |
518 |
-+ if (unlikely(INTERNAL_SYSCALL_ERROR_P (ret, err))) |
519 |
-+ return INTERNAL_SYSCALL_ERRNO (ret, err); |
520 |
-+ return 0; |
521 |
-+} |
522 |
-+# if defined __UCLIBC_HAS_LFS__ && __WORDSIZE == 64 |
523 |
-+strong_alias(posix_fallocate,posix_fallocate64) |
524 |
-+# endif |
525 |
-+#endif |
526 |
-diff --git a/libc/sysdeps/linux/common/posix_fallocate64.c b/libc/sysdeps/linux/common/posix_fallocate64.c |
527 |
-new file mode 100644 |
528 |
-index 0000000..818d868 |
529 |
---- /dev/null |
530 |
-+++ b/libc/sysdeps/linux/common/posix_fallocate64.c |
531 |
-@@ -0,0 +1,39 @@ |
532 |
-+/* vi: set sw=4 ts=4: */ |
533 |
-+/* |
534 |
-+ * posix_fallocate() for uClibc |
535 |
-+ * http://www.opengroup.org/onlinepubs/9699919799/functions/posix_fallocate.html |
536 |
-+ * |
537 |
-+ * Copyright (C) 2000-2006 Erik Andersen <andersen@××××××.org> |
538 |
-+ * |
539 |
-+ * Licensed under the LGPL v2.1 or later, see the file COPYING.LIB in this tarball. |
540 |
-+ */ |
541 |
-+ |
542 |
-+#include <sys/syscall.h> |
543 |
-+#include <fcntl.h> |
544 |
-+#include <bits/kernel-features.h> |
545 |
-+#include <stdint.h> |
546 |
-+ |
547 |
-+#if defined __NR_fallocate |
548 |
-+ |
549 |
-+# if __WORDSIZE == 64 |
550 |
-+/* Can use normal posix_fallocate() */ |
551 |
-+# elif __WORDSIZE == 32 |
552 |
-+int posix_fallocate64(int fd, __off64_t offset, __off64_t len) |
553 |
-+{ |
554 |
-+ int ret; |
555 |
-+ uint32_t off_low = offset & 0xffffffff; |
556 |
-+ uint32_t off_high = offset >> 32; |
557 |
-+ uint32_t len_low = len & 0xffffffff; |
558 |
-+ uint32_t len_high = len >> 32; |
559 |
-+ INTERNAL_SYSCALL_DECL(err); |
560 |
-+ ret = (int) (INTERNAL_SYSCALL(fallocate, err, 6, fd, 0, |
561 |
-+ __LONG_LONG_PAIR (off_high, off_low), |
562 |
-+ __LONG_LONG_PAIR (len_high, len_low))); |
563 |
-+ if (unlikely(INTERNAL_SYSCALL_ERROR_P (ret, err))) |
564 |
-+ return INTERNAL_SYSCALL_ERRNO (ret, err); |
565 |
-+ return 0; |
566 |
-+} |
567 |
-+# else |
568 |
-+# error your machine is neither 32 bit or 64 bit ... it must be magical |
569 |
-+# endif |
570 |
-+#endif |
571 |
-diff --git a/test/.gitignore b/test/.gitignore |
572 |
-index c068f89..ec04628 100644 |
573 |
---- a/test/.gitignore |
574 |
-+++ b/test/.gitignore |
575 |
-@@ -319,6 +319,8 @@ unistd/getcwd |
576 |
- unistd/getopt |
577 |
- unistd/getopt_long |
578 |
- unistd/tstgetopt |
579 |
-+unistd/tst-posix_fallocate |
580 |
-+unistd/tst-posix_fallocate64 |
581 |
- unistd/tst-preadwrite |
582 |
- unistd/tst-preadwrite64 |
583 |
- unistd/vfork |
584 |
-diff --git a/test/unistd/Makefile.in b/test/unistd/Makefile.in |
585 |
-index c542f98..24b9a37 100644 |
586 |
---- a/test/unistd/Makefile.in |
587 |
-+++ b/test/unistd/Makefile.in |
588 |
-@@ -2,7 +2,10 @@ |
589 |
- # Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball. |
590 |
- |
591 |
- ifeq ($(UCLIBC_HAS_LFS),) |
592 |
--TESTS_DISABLED := tst-preadwrite64 |
593 |
-+TESTS_DISABLED := tst-preadwrite64 tst-posix_fallocate64 |
594 |
-+endif |
595 |
-+ifeq ($(UCLIBC_HAS_ADVANCED_REALTIME),) |
596 |
-+TESTS_DISABLED := tst-posix_fallocate |
597 |
- endif |
598 |
- OPTS_getopt := -abcXXX -9 |
599 |
- OPTS_getopt_long := --add XXX --delete YYY --verbose |
600 |
-diff --git a/test/unistd/tst-posix_fallocate.c b/test/unistd/tst-posix_fallocate.c |
601 |
-new file mode 100644 |
602 |
-index 0000000..d41c604 |
603 |
---- /dev/null |
604 |
-+++ b/test/unistd/tst-posix_fallocate.c |
605 |
-@@ -0,0 +1,127 @@ |
606 |
-+#include <fcntl.h> |
607 |
-+#include <sys/stat.h> |
608 |
-+ |
609 |
-+#ifndef TST_POSIX_FALLOCATE64 |
610 |
-+# define stat64 stat |
611 |
-+# define fstat64 fstat |
612 |
-+# else |
613 |
-+# ifndef O_LARGEFILE |
614 |
-+# error no O_LARGEFILE but you want to test with LFS enabled |
615 |
-+# endif |
616 |
-+#endif |
617 |
-+ |
618 |
-+static void do_prepare (void); |
619 |
-+#define PREPARE(argc, argv) do_prepare () |
620 |
-+static int do_test (void); |
621 |
-+#define TEST_FUNCTION do_test () |
622 |
-+#include <test-skeleton.c> |
623 |
-+ |
624 |
-+static int fd; |
625 |
-+static void |
626 |
-+do_prepare (void) |
627 |
-+{ |
628 |
-+ fd = create_temp_file ("tst-posix_fallocate.", NULL); |
629 |
-+ if (fd == -1) |
630 |
-+ { |
631 |
-+ printf ("cannot create temporary file: %m\n"); |
632 |
-+ exit (1); |
633 |
-+ } |
634 |
-+} |
635 |
-+ |
636 |
-+ |
637 |
-+static int |
638 |
-+do_test (void) |
639 |
-+{ |
640 |
-+ struct stat64 st; |
641 |
-+ |
642 |
-+ if (fstat64 (fd, &st) != 0) |
643 |
-+ { |
644 |
-+ puts ("1st fstat failed"); |
645 |
-+ return 1; |
646 |
-+ } |
647 |
-+ |
648 |
-+ if (st.st_size != 0) |
649 |
-+ { |
650 |
-+ puts ("file not created with size 0"); |
651 |
-+ return 1; |
652 |
-+ } |
653 |
-+ |
654 |
-+ if (posix_fallocate (fd, 512, 768) != 0) |
655 |
-+ { |
656 |
-+ puts ("1st posix_fallocate call failed"); |
657 |
-+ return 1; |
658 |
-+ } |
659 |
-+ |
660 |
-+ if (fstat64 (fd, &st) != 0) |
661 |
-+ { |
662 |
-+ puts ("2nd fstat failed"); |
663 |
-+ return 1; |
664 |
-+ } |
665 |
-+ |
666 |
-+ if (st.st_size != 512 + 768) |
667 |
-+ { |
668 |
-+ printf ("file size after 1st posix_fallocate call is %llu, expected %u\n", |
669 |
-+ (unsigned long long int) st.st_size, 512u + 768u); |
670 |
-+ return 1; |
671 |
-+ } |
672 |
-+ |
673 |
-+ if (posix_fallocate (fd, 0, 1024) != 0) |
674 |
-+ { |
675 |
-+ puts ("2nd posix_fallocate call failed"); |
676 |
-+ return 1; |
677 |
-+ } |
678 |
-+ |
679 |
-+ if (fstat64 (fd, &st) != 0) |
680 |
-+ { |
681 |
-+ puts ("3rd fstat failed"); |
682 |
-+ return 1; |
683 |
-+ } |
684 |
-+ |
685 |
-+ if (st.st_size != 512 + 768) |
686 |
-+ { |
687 |
-+ puts ("file size changed in 2nd posix_fallocate"); |
688 |
-+ return 1; |
689 |
-+ } |
690 |
-+ |
691 |
-+ if (posix_fallocate (fd, 2048, 64) != 0) |
692 |
-+ { |
693 |
-+ puts ("3rd posix_fallocate call failed"); |
694 |
-+ return 1; |
695 |
-+ } |
696 |
-+ |
697 |
-+ if (fstat64 (fd, &st) != 0) |
698 |
-+ { |
699 |
-+ puts ("4th fstat failed"); |
700 |
-+ return 1; |
701 |
-+ } |
702 |
-+ |
703 |
-+ if (st.st_size != 2048 + 64) |
704 |
-+ { |
705 |
-+ printf ("file size after 3rd posix_fallocate call is %llu, expected %u\n", |
706 |
-+ (unsigned long long int) st.st_size, 2048u + 64u); |
707 |
-+ return 1; |
708 |
-+ } |
709 |
-+#ifdef TST_POSIX_FALLOCATE64 |
710 |
-+ if (posix_fallocate64 (fd, 4097ULL, 4294967295ULL + 2ULL) != 0) |
711 |
-+ { |
712 |
-+ puts ("4th posix_fallocate call failed"); |
713 |
-+ return 1; |
714 |
-+ } |
715 |
-+ |
716 |
-+ if (fstat64 (fd, &st) != 0) |
717 |
-+ { |
718 |
-+ puts ("5th fstat failed"); |
719 |
-+ return 1; |
720 |
-+ } |
721 |
-+ |
722 |
-+ if (st.st_size != 4097ULL + 4294967295ULL + 2ULL) |
723 |
-+ { |
724 |
-+ printf ("file size after 4th posix_fallocate call is %llu, expected %llu\n", |
725 |
-+ (unsigned long long int) st.st_size, 4097ULL + 4294967295ULL + 2ULL); |
726 |
-+ return 1; |
727 |
-+ } |
728 |
-+#endif |
729 |
-+ close (fd); |
730 |
-+ |
731 |
-+ return 0; |
732 |
-+} |
733 |
-diff --git a/test/unistd/tst-posix_fallocate64.c b/test/unistd/tst-posix_fallocate64.c |
734 |
-new file mode 100644 |
735 |
-index 0000000..b1ee0ff |
736 |
---- /dev/null |
737 |
-+++ b/test/unistd/tst-posix_fallocate64.c |
738 |
-@@ -0,0 +1,2 @@ |
739 |
-+#define TST_POSIX_FALLOCATE64 |
740 |
-+#include "tst-posix_fallocate.c" |
741 |
--- |
742 |
-cgit v0.9.1 |
743 |
|
744 |
diff --git a/tools-uclibc/portage.mips32r2.vanilla/savedconfig/sys-libs/uclibc-0.9.33.2-r3 b/tools-uclibc/portage.mips32r2.vanilla/savedconfig/sys-libs/uclibc-0.9.33.2-r4 |
745 |
similarity index 100% |
746 |
rename from tools-uclibc/portage.mips32r2.vanilla/savedconfig/sys-libs/uclibc-0.9.33.2-r3 |
747 |
rename to tools-uclibc/portage.mips32r2.vanilla/savedconfig/sys-libs/uclibc-0.9.33.2-r4 |
748 |
|
749 |
diff --git a/tools-uclibc/portage.mipsel3.hardened/package.accept_keywords/gcc b/tools-uclibc/portage.mipsel3.hardened/package.accept_keywords/gcc |
750 |
index 18235b7..e48c4b7 100644 |
751 |
--- a/tools-uclibc/portage.mipsel3.hardened/package.accept_keywords/gcc |
752 |
+++ b/tools-uclibc/portage.mipsel3.hardened/package.accept_keywords/gcc |
753 |
@@ -1 +1 @@ |
754 |
-=sys-devel/gcc-4.6.3-r99 ~mips |
755 |
+=sys-devel/gcc-4.8.0 ** |
756 |
|
757 |
diff --git a/tools-uclibc/portage.mipsel3.hardened/package.mask/python b/tools-uclibc/portage.mipsel3.hardened/package.mask/python |
758 |
new file mode 100644 |
759 |
index 0000000..72c698b |
760 |
--- /dev/null |
761 |
+++ b/tools-uclibc/portage.mipsel3.hardened/package.mask/python |
762 |
@@ -0,0 +1 @@ |
763 |
+=dev-lang/python-2.7.4* |
764 |
|
765 |
diff --git a/tools-uclibc/portage.mipsel3.hardened/package.unmask/gcc b/tools-uclibc/portage.mipsel3.hardened/package.unmask/gcc |
766 |
new file mode 100644 |
767 |
index 0000000..ccc13f2 |
768 |
--- /dev/null |
769 |
+++ b/tools-uclibc/portage.mipsel3.hardened/package.unmask/gcc |
770 |
@@ -0,0 +1 @@ |
771 |
+=sys-devel/gcc-4.8.0 |
772 |
|
773 |
diff --git a/tools-uclibc/portage.mipsel3.hardened/patches/sys-libs/uclibc/01_add-posix_fallocate.patch b/tools-uclibc/portage.mipsel3.hardened/patches/sys-libs/uclibc/01_add-posix_fallocate.patch |
774 |
deleted file mode 100644 |
775 |
index dc7bbd7..0000000 |
776 |
--- a/tools-uclibc/portage.mipsel3.hardened/patches/sys-libs/uclibc/01_add-posix_fallocate.patch |
777 |
+++ /dev/null |
778 |
@@ -1,321 +0,0 @@ |
779 |
-From 5643900913f64c00f1c2958914586708efa5a473 Mon Sep 17 00:00:00 2001 |
780 |
-From: Bernhard Reutner-Fischer <rep.dot.nop@×××××.com> |
781 |
-Date: Tue, 17 Apr 2012 07:30:15 +0000 |
782 |
-Subject: libc: add posix_fallocate() |
783 |
- |
784 |
-Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@×××××.com> |
785 |
---- |
786 |
-diff --git a/include/fcntl.h b/include/fcntl.h |
787 |
-index ed009dd..c749ad5 100644 |
788 |
---- a/include/fcntl.h |
789 |
-+++ b/include/fcntl.h |
790 |
-@@ -217,9 +217,7 @@ extern int posix_fadvise64 (int __fd, __off64_t __offset, __off64_t __len, |
791 |
- |
792 |
- #endif |
793 |
- |
794 |
--#if 0 /* && defined __UCLIBC_HAS_ADVANCED_REALTIME__ */ |
795 |
-- |
796 |
--/* FIXME -- uClibc should probably implement these... */ |
797 |
-+#if defined __UCLIBC_HAS_ADVANCED_REALTIME__ |
798 |
- |
799 |
- /* Reserve storage for the data of the file associated with FD. |
800 |
- |
801 |
-diff --git a/libc/sysdeps/linux/common/Makefile.in b/libc/sysdeps/linux/common/Makefile.in |
802 |
-index 566722d..29566dd 100644 |
803 |
---- a/libc/sysdeps/linux/common/Makefile.in |
804 |
-+++ b/libc/sysdeps/linux/common/Makefile.in |
805 |
-@@ -82,7 +82,8 @@ CSRC-$(UCLIBC_HAS_REALTIME) += clock_getres.c clock_gettime.c clock_settime.c \ |
806 |
- sched_get_priority_max.c sched_get_priority_min.c sched_getscheduler.c \ |
807 |
- sched_rr_get_interval.c sched_setparam.c sched_setscheduler.c sigqueue.c |
808 |
- # clock_getcpuclockid|clock_nanosleep|mq_timedreceive|mq_timedsend|posix_fadvise|posix_fallocate|posix_madvise|posix_memalign|posix_mem_offset|posix_spawnattr_destroy|posix_spawnattr_init|posix_spawnattr_getflags|posix_spawnattr_setflags|posix_spawnattr_getpgroup|posix_spawnattr_setpgroup|posix_spawnattr_getschedparam|posix_spawnattr_setschedparam|posix_spawnattr_getschedpolicy|posix_spawnattr_setschedpolicy|posix_spawnattr_getsigdefault|posix_spawnattr_setsigdefault|posix_spawnattr_getsigmask|posix_spawnattr_setsigmask|posix_spawnattr_init|posix_spawnattr_setflags|posix_spawnattr_setpgroup|posix_spawnattr_setschedparam|posix_spawnattr_setschedpolicy|posix_spawnattr_setsigdefault|posix_spawnattr_setsigmask|posix_spawn_file_actions_addclose|posix_spawn_file_actions_addopen|posix_spawn_file_actions_adddup2|posix_spawn_file_actions_addopen|posix_spawn_file_actions_destroy|posix_spawn_file_actions_init|posix_spawn_file_actions_init|posix_spawn|posix_spawnp|posix_spawnp|posix_typed_mem_ |
809 |
get_info|pthread_mutex_timedlock|sem_timedwait |
810 |
--CSRC-$(UCLIBC_HAS_ADVANCED_REALTIME) += posix_fadvise64.c posix_fadvise.c posix_madvise.c |
811 |
-+CSRC-$(UCLIBC_HAS_ADVANCED_REALTIME) += posix_fadvise64.c posix_fadvise.c posix_madvise.c \ |
812 |
-+ posix_fallocate.c posix_fallocate64.c |
813 |
- CSRC-$(UCLIBC_SUSV4_LEGACY) += utime.c |
814 |
- CSRC-$(UCLIBC_HAS_EPOLL) += epoll.c |
815 |
- CSRC-$(UCLIBC_HAS_XATTR) += xattr.c |
816 |
-diff --git a/libc/sysdeps/linux/common/bits/kernel-features.h b/libc/sysdeps/linux/common/bits/kernel-features.h |
817 |
-index 4d1e0cb..6184c2b 100644 |
818 |
---- a/libc/sysdeps/linux/common/bits/kernel-features.h |
819 |
-+++ b/libc/sysdeps/linux/common/bits/kernel-features.h |
820 |
-@@ -495,6 +495,14 @@ |
821 |
- # define __ASSUME_PRIVATE_FUTEX 1 |
822 |
- #endif |
823 |
- |
824 |
-+/* Support for fallocate was added in 2.6.23, |
825 |
-+ on s390 only after 2.6.23-rc1, on alpha only after 2.6.33-rc1. */ |
826 |
-+#if __LINUX_KERNEL_VERSION >= 0x020617 \ |
827 |
-+ && (!defined __s390__ || __LINUX_KERNEL_VERSION >= 0x020618) \ |
828 |
-+ && (!defined __alpha__ || __LINUX_KERNEL_VERSION >= 0x020621) |
829 |
-+# define __ASSUME_FALLOCATE 1 |
830 |
-+#endif |
831 |
-+ |
832 |
- /* getcpu is a syscall for x86-64 since 3.1. */ |
833 |
- #if defined __x86_64__ && __LINUX_KERNEL_VERSION >= 0x030100 |
834 |
- # define __ASSUME_GETCPU_SYSCALL 1 |
835 |
-diff --git a/libc/sysdeps/linux/common/posix_fallocate.c b/libc/sysdeps/linux/common/posix_fallocate.c |
836 |
-new file mode 100644 |
837 |
-index 0000000..9aaa6ce |
838 |
---- /dev/null |
839 |
-+++ b/libc/sysdeps/linux/common/posix_fallocate.c |
840 |
-@@ -0,0 +1,43 @@ |
841 |
-+/* vi: set sw=4 ts=4: */ |
842 |
-+/* |
843 |
-+ * posix_fallocate() for uClibc |
844 |
-+ * http://www.opengroup.org/onlinepubs/9699919799/functions/posix_fallocate.html |
845 |
-+ * |
846 |
-+ * Copyright (C) 2000-2006 Erik Andersen <andersen@××××××.org> |
847 |
-+ * |
848 |
-+ * Licensed under the LGPL v2.1 or later, see the file COPYING.LIB in this tarball. |
849 |
-+ */ |
850 |
-+ |
851 |
-+#include <sys/syscall.h> |
852 |
-+#include <fcntl.h> |
853 |
-+#include <bits/kernel-features.h> |
854 |
-+#include <stdint.h> |
855 |
-+ |
856 |
-+#if defined __NR_fallocate |
857 |
-+int posix_fallocate(int fd, __off_t offset, __off_t len) |
858 |
-+{ |
859 |
-+ int ret; |
860 |
-+ |
861 |
-+# if __WORDSIZE == 32 |
862 |
-+ uint32_t off_low = offset; |
863 |
-+ uint32_t len_low = len; |
864 |
-+ /* may assert that these >>31 are 0 */ |
865 |
-+ uint32_t zero = 0; |
866 |
-+ INTERNAL_SYSCALL_DECL(err); |
867 |
-+ ret = (int) (INTERNAL_SYSCALL(fallocate, err, 6, fd, 0, |
868 |
-+ __LONG_LONG_PAIR (zero, off_low), |
869 |
-+ __LONG_LONG_PAIR (zero, len_low))); |
870 |
-+# elif __WORDSIZE == 64 |
871 |
-+ INTERNAL_SYSCALL_DECL(err); |
872 |
-+ ret = (int) (INTERNAL_SYSCALL(fallocate, err, 4, fd, 0, offset, len)); |
873 |
-+# else |
874 |
-+# error your machine is neither 32 bit or 64 bit ... it must be magical |
875 |
-+#endif |
876 |
-+ if (unlikely(INTERNAL_SYSCALL_ERROR_P (ret, err))) |
877 |
-+ return INTERNAL_SYSCALL_ERRNO (ret, err); |
878 |
-+ return 0; |
879 |
-+} |
880 |
-+# if defined __UCLIBC_HAS_LFS__ && __WORDSIZE == 64 |
881 |
-+strong_alias(posix_fallocate,posix_fallocate64) |
882 |
-+# endif |
883 |
-+#endif |
884 |
-diff --git a/libc/sysdeps/linux/common/posix_fallocate64.c b/libc/sysdeps/linux/common/posix_fallocate64.c |
885 |
-new file mode 100644 |
886 |
-index 0000000..818d868 |
887 |
---- /dev/null |
888 |
-+++ b/libc/sysdeps/linux/common/posix_fallocate64.c |
889 |
-@@ -0,0 +1,39 @@ |
890 |
-+/* vi: set sw=4 ts=4: */ |
891 |
-+/* |
892 |
-+ * posix_fallocate() for uClibc |
893 |
-+ * http://www.opengroup.org/onlinepubs/9699919799/functions/posix_fallocate.html |
894 |
-+ * |
895 |
-+ * Copyright (C) 2000-2006 Erik Andersen <andersen@××××××.org> |
896 |
-+ * |
897 |
-+ * Licensed under the LGPL v2.1 or later, see the file COPYING.LIB in this tarball. |
898 |
-+ */ |
899 |
-+ |
900 |
-+#include <sys/syscall.h> |
901 |
-+#include <fcntl.h> |
902 |
-+#include <bits/kernel-features.h> |
903 |
-+#include <stdint.h> |
904 |
-+ |
905 |
-+#if defined __NR_fallocate |
906 |
-+ |
907 |
-+# if __WORDSIZE == 64 |
908 |
-+/* Can use normal posix_fallocate() */ |
909 |
-+# elif __WORDSIZE == 32 |
910 |
-+int posix_fallocate64(int fd, __off64_t offset, __off64_t len) |
911 |
-+{ |
912 |
-+ int ret; |
913 |
-+ uint32_t off_low = offset & 0xffffffff; |
914 |
-+ uint32_t off_high = offset >> 32; |
915 |
-+ uint32_t len_low = len & 0xffffffff; |
916 |
-+ uint32_t len_high = len >> 32; |
917 |
-+ INTERNAL_SYSCALL_DECL(err); |
918 |
-+ ret = (int) (INTERNAL_SYSCALL(fallocate, err, 6, fd, 0, |
919 |
-+ __LONG_LONG_PAIR (off_high, off_low), |
920 |
-+ __LONG_LONG_PAIR (len_high, len_low))); |
921 |
-+ if (unlikely(INTERNAL_SYSCALL_ERROR_P (ret, err))) |
922 |
-+ return INTERNAL_SYSCALL_ERRNO (ret, err); |
923 |
-+ return 0; |
924 |
-+} |
925 |
-+# else |
926 |
-+# error your machine is neither 32 bit or 64 bit ... it must be magical |
927 |
-+# endif |
928 |
-+#endif |
929 |
-diff --git a/test/.gitignore b/test/.gitignore |
930 |
-index c068f89..ec04628 100644 |
931 |
---- a/test/.gitignore |
932 |
-+++ b/test/.gitignore |
933 |
-@@ -319,6 +319,8 @@ unistd/getcwd |
934 |
- unistd/getopt |
935 |
- unistd/getopt_long |
936 |
- unistd/tstgetopt |
937 |
-+unistd/tst-posix_fallocate |
938 |
-+unistd/tst-posix_fallocate64 |
939 |
- unistd/tst-preadwrite |
940 |
- unistd/tst-preadwrite64 |
941 |
- unistd/vfork |
942 |
-diff --git a/test/unistd/Makefile.in b/test/unistd/Makefile.in |
943 |
-index c542f98..24b9a37 100644 |
944 |
---- a/test/unistd/Makefile.in |
945 |
-+++ b/test/unistd/Makefile.in |
946 |
-@@ -2,7 +2,10 @@ |
947 |
- # Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball. |
948 |
- |
949 |
- ifeq ($(UCLIBC_HAS_LFS),) |
950 |
--TESTS_DISABLED := tst-preadwrite64 |
951 |
-+TESTS_DISABLED := tst-preadwrite64 tst-posix_fallocate64 |
952 |
-+endif |
953 |
-+ifeq ($(UCLIBC_HAS_ADVANCED_REALTIME),) |
954 |
-+TESTS_DISABLED := tst-posix_fallocate |
955 |
- endif |
956 |
- OPTS_getopt := -abcXXX -9 |
957 |
- OPTS_getopt_long := --add XXX --delete YYY --verbose |
958 |
-diff --git a/test/unistd/tst-posix_fallocate.c b/test/unistd/tst-posix_fallocate.c |
959 |
-new file mode 100644 |
960 |
-index 0000000..d41c604 |
961 |
---- /dev/null |
962 |
-+++ b/test/unistd/tst-posix_fallocate.c |
963 |
-@@ -0,0 +1,127 @@ |
964 |
-+#include <fcntl.h> |
965 |
-+#include <sys/stat.h> |
966 |
-+ |
967 |
-+#ifndef TST_POSIX_FALLOCATE64 |
968 |
-+# define stat64 stat |
969 |
-+# define fstat64 fstat |
970 |
-+# else |
971 |
-+# ifndef O_LARGEFILE |
972 |
-+# error no O_LARGEFILE but you want to test with LFS enabled |
973 |
-+# endif |
974 |
-+#endif |
975 |
-+ |
976 |
-+static void do_prepare (void); |
977 |
-+#define PREPARE(argc, argv) do_prepare () |
978 |
-+static int do_test (void); |
979 |
-+#define TEST_FUNCTION do_test () |
980 |
-+#include <test-skeleton.c> |
981 |
-+ |
982 |
-+static int fd; |
983 |
-+static void |
984 |
-+do_prepare (void) |
985 |
-+{ |
986 |
-+ fd = create_temp_file ("tst-posix_fallocate.", NULL); |
987 |
-+ if (fd == -1) |
988 |
-+ { |
989 |
-+ printf ("cannot create temporary file: %m\n"); |
990 |
-+ exit (1); |
991 |
-+ } |
992 |
-+} |
993 |
-+ |
994 |
-+ |
995 |
-+static int |
996 |
-+do_test (void) |
997 |
-+{ |
998 |
-+ struct stat64 st; |
999 |
-+ |
1000 |
-+ if (fstat64 (fd, &st) != 0) |
1001 |
-+ { |
1002 |
-+ puts ("1st fstat failed"); |
1003 |
-+ return 1; |
1004 |
-+ } |
1005 |
-+ |
1006 |
-+ if (st.st_size != 0) |
1007 |
-+ { |
1008 |
-+ puts ("file not created with size 0"); |
1009 |
-+ return 1; |
1010 |
-+ } |
1011 |
-+ |
1012 |
-+ if (posix_fallocate (fd, 512, 768) != 0) |
1013 |
-+ { |
1014 |
-+ puts ("1st posix_fallocate call failed"); |
1015 |
-+ return 1; |
1016 |
-+ } |
1017 |
-+ |
1018 |
-+ if (fstat64 (fd, &st) != 0) |
1019 |
-+ { |
1020 |
-+ puts ("2nd fstat failed"); |
1021 |
-+ return 1; |
1022 |
-+ } |
1023 |
-+ |
1024 |
-+ if (st.st_size != 512 + 768) |
1025 |
-+ { |
1026 |
-+ printf ("file size after 1st posix_fallocate call is %llu, expected %u\n", |
1027 |
-+ (unsigned long long int) st.st_size, 512u + 768u); |
1028 |
-+ return 1; |
1029 |
-+ } |
1030 |
-+ |
1031 |
-+ if (posix_fallocate (fd, 0, 1024) != 0) |
1032 |
-+ { |
1033 |
-+ puts ("2nd posix_fallocate call failed"); |
1034 |
-+ return 1; |
1035 |
-+ } |
1036 |
-+ |
1037 |
-+ if (fstat64 (fd, &st) != 0) |
1038 |
-+ { |
1039 |
-+ puts ("3rd fstat failed"); |
1040 |
-+ return 1; |
1041 |
-+ } |
1042 |
-+ |
1043 |
-+ if (st.st_size != 512 + 768) |
1044 |
-+ { |
1045 |
-+ puts ("file size changed in 2nd posix_fallocate"); |
1046 |
-+ return 1; |
1047 |
-+ } |
1048 |
-+ |
1049 |
-+ if (posix_fallocate (fd, 2048, 64) != 0) |
1050 |
-+ { |
1051 |
-+ puts ("3rd posix_fallocate call failed"); |
1052 |
-+ return 1; |
1053 |
-+ } |
1054 |
-+ |
1055 |
-+ if (fstat64 (fd, &st) != 0) |
1056 |
-+ { |
1057 |
-+ puts ("4th fstat failed"); |
1058 |
-+ return 1; |
1059 |
-+ } |
1060 |
-+ |
1061 |
-+ if (st.st_size != 2048 + 64) |
1062 |
-+ { |
1063 |
-+ printf ("file size after 3rd posix_fallocate call is %llu, expected %u\n", |
1064 |
-+ (unsigned long long int) st.st_size, 2048u + 64u); |
1065 |
-+ return 1; |
1066 |
-+ } |
1067 |
-+#ifdef TST_POSIX_FALLOCATE64 |
1068 |
-+ if (posix_fallocate64 (fd, 4097ULL, 4294967295ULL + 2ULL) != 0) |
1069 |
-+ { |
1070 |
-+ puts ("4th posix_fallocate call failed"); |
1071 |
-+ return 1; |
1072 |
-+ } |
1073 |
-+ |
1074 |
-+ if (fstat64 (fd, &st) != 0) |
1075 |
-+ { |
1076 |
-+ puts ("5th fstat failed"); |
1077 |
-+ return 1; |
1078 |
-+ } |
1079 |
-+ |
1080 |
-+ if (st.st_size != 4097ULL + 4294967295ULL + 2ULL) |
1081 |
-+ { |
1082 |
-+ printf ("file size after 4th posix_fallocate call is %llu, expected %llu\n", |
1083 |
-+ (unsigned long long int) st.st_size, 4097ULL + 4294967295ULL + 2ULL); |
1084 |
-+ return 1; |
1085 |
-+ } |
1086 |
-+#endif |
1087 |
-+ close (fd); |
1088 |
-+ |
1089 |
-+ return 0; |
1090 |
-+} |
1091 |
-diff --git a/test/unistd/tst-posix_fallocate64.c b/test/unistd/tst-posix_fallocate64.c |
1092 |
-new file mode 100644 |
1093 |
-index 0000000..b1ee0ff |
1094 |
---- /dev/null |
1095 |
-+++ b/test/unistd/tst-posix_fallocate64.c |
1096 |
-@@ -0,0 +1,2 @@ |
1097 |
-+#define TST_POSIX_FALLOCATE64 |
1098 |
-+#include "tst-posix_fallocate.c" |
1099 |
--- |
1100 |
-cgit v0.9.1 |
1101 |
|
1102 |
diff --git a/tools-uclibc/portage.mipsel3.hardened/savedconfig/sys-libs/uclibc-0.9.33.2-r3 b/tools-uclibc/portage.mipsel3.hardened/savedconfig/sys-libs/uclibc-0.9.33.2-r4 |
1103 |
similarity index 100% |
1104 |
rename from tools-uclibc/portage.mipsel3.hardened/savedconfig/sys-libs/uclibc-0.9.33.2-r3 |
1105 |
rename to tools-uclibc/portage.mipsel3.hardened/savedconfig/sys-libs/uclibc-0.9.33.2-r4 |
1106 |
|
1107 |
diff --git a/tools-uclibc/portage.mipsel3.vanilla/package.accept_keywords/gcc b/tools-uclibc/portage.mipsel3.vanilla/package.accept_keywords/gcc |
1108 |
index 18235b7..e48c4b7 100644 |
1109 |
--- a/tools-uclibc/portage.mipsel3.vanilla/package.accept_keywords/gcc |
1110 |
+++ b/tools-uclibc/portage.mipsel3.vanilla/package.accept_keywords/gcc |
1111 |
@@ -1 +1 @@ |
1112 |
-=sys-devel/gcc-4.6.3-r99 ~mips |
1113 |
+=sys-devel/gcc-4.8.0 ** |
1114 |
|
1115 |
diff --git a/tools-uclibc/portage.mipsel3.vanilla/package.mask/python b/tools-uclibc/portage.mipsel3.vanilla/package.mask/python |
1116 |
new file mode 100644 |
1117 |
index 0000000..72c698b |
1118 |
--- /dev/null |
1119 |
+++ b/tools-uclibc/portage.mipsel3.vanilla/package.mask/python |
1120 |
@@ -0,0 +1 @@ |
1121 |
+=dev-lang/python-2.7.4* |
1122 |
|
1123 |
diff --git a/tools-uclibc/portage.mipsel3.vanilla/package.unmask/gcc b/tools-uclibc/portage.mipsel3.vanilla/package.unmask/gcc |
1124 |
new file mode 100644 |
1125 |
index 0000000..ccc13f2 |
1126 |
--- /dev/null |
1127 |
+++ b/tools-uclibc/portage.mipsel3.vanilla/package.unmask/gcc |
1128 |
@@ -0,0 +1 @@ |
1129 |
+=sys-devel/gcc-4.8.0 |
1130 |
|
1131 |
diff --git a/tools-uclibc/portage.mipsel3.vanilla/patches/sys-libs/uclibc/01_add-posix_fallocate.patch b/tools-uclibc/portage.mipsel3.vanilla/patches/sys-libs/uclibc/01_add-posix_fallocate.patch |
1132 |
deleted file mode 100644 |
1133 |
index dc7bbd7..0000000 |
1134 |
--- a/tools-uclibc/portage.mipsel3.vanilla/patches/sys-libs/uclibc/01_add-posix_fallocate.patch |
1135 |
+++ /dev/null |
1136 |
@@ -1,321 +0,0 @@ |
1137 |
-From 5643900913f64c00f1c2958914586708efa5a473 Mon Sep 17 00:00:00 2001 |
1138 |
-From: Bernhard Reutner-Fischer <rep.dot.nop@×××××.com> |
1139 |
-Date: Tue, 17 Apr 2012 07:30:15 +0000 |
1140 |
-Subject: libc: add posix_fallocate() |
1141 |
- |
1142 |
-Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@×××××.com> |
1143 |
---- |
1144 |
-diff --git a/include/fcntl.h b/include/fcntl.h |
1145 |
-index ed009dd..c749ad5 100644 |
1146 |
---- a/include/fcntl.h |
1147 |
-+++ b/include/fcntl.h |
1148 |
-@@ -217,9 +217,7 @@ extern int posix_fadvise64 (int __fd, __off64_t __offset, __off64_t __len, |
1149 |
- |
1150 |
- #endif |
1151 |
- |
1152 |
--#if 0 /* && defined __UCLIBC_HAS_ADVANCED_REALTIME__ */ |
1153 |
-- |
1154 |
--/* FIXME -- uClibc should probably implement these... */ |
1155 |
-+#if defined __UCLIBC_HAS_ADVANCED_REALTIME__ |
1156 |
- |
1157 |
- /* Reserve storage for the data of the file associated with FD. |
1158 |
- |
1159 |
-diff --git a/libc/sysdeps/linux/common/Makefile.in b/libc/sysdeps/linux/common/Makefile.in |
1160 |
-index 566722d..29566dd 100644 |
1161 |
---- a/libc/sysdeps/linux/common/Makefile.in |
1162 |
-+++ b/libc/sysdeps/linux/common/Makefile.in |
1163 |
-@@ -82,7 +82,8 @@ CSRC-$(UCLIBC_HAS_REALTIME) += clock_getres.c clock_gettime.c clock_settime.c \ |
1164 |
- sched_get_priority_max.c sched_get_priority_min.c sched_getscheduler.c \ |
1165 |
- sched_rr_get_interval.c sched_setparam.c sched_setscheduler.c sigqueue.c |
1166 |
- # clock_getcpuclockid|clock_nanosleep|mq_timedreceive|mq_timedsend|posix_fadvise|posix_fallocate|posix_madvise|posix_memalign|posix_mem_offset|posix_spawnattr_destroy|posix_spawnattr_init|posix_spawnattr_getflags|posix_spawnattr_setflags|posix_spawnattr_getpgroup|posix_spawnattr_setpgroup|posix_spawnattr_getschedparam|posix_spawnattr_setschedparam|posix_spawnattr_getschedpolicy|posix_spawnattr_setschedpolicy|posix_spawnattr_getsigdefault|posix_spawnattr_setsigdefault|posix_spawnattr_getsigmask|posix_spawnattr_setsigmask|posix_spawnattr_init|posix_spawnattr_setflags|posix_spawnattr_setpgroup|posix_spawnattr_setschedparam|posix_spawnattr_setschedpolicy|posix_spawnattr_setsigdefault|posix_spawnattr_setsigmask|posix_spawn_file_actions_addclose|posix_spawn_file_actions_addopen|posix_spawn_file_actions_adddup2|posix_spawn_file_actions_addopen|posix_spawn_file_actions_destroy|posix_spawn_file_actions_init|posix_spawn_file_actions_init|posix_spawn|posix_spawnp|posix_spawnp|posix_typed_mem_ |
1167 |
get_info|pthread_mutex_timedlock|sem_timedwait |
1168 |
--CSRC-$(UCLIBC_HAS_ADVANCED_REALTIME) += posix_fadvise64.c posix_fadvise.c posix_madvise.c |
1169 |
-+CSRC-$(UCLIBC_HAS_ADVANCED_REALTIME) += posix_fadvise64.c posix_fadvise.c posix_madvise.c \ |
1170 |
-+ posix_fallocate.c posix_fallocate64.c |
1171 |
- CSRC-$(UCLIBC_SUSV4_LEGACY) += utime.c |
1172 |
- CSRC-$(UCLIBC_HAS_EPOLL) += epoll.c |
1173 |
- CSRC-$(UCLIBC_HAS_XATTR) += xattr.c |
1174 |
-diff --git a/libc/sysdeps/linux/common/bits/kernel-features.h b/libc/sysdeps/linux/common/bits/kernel-features.h |
1175 |
-index 4d1e0cb..6184c2b 100644 |
1176 |
---- a/libc/sysdeps/linux/common/bits/kernel-features.h |
1177 |
-+++ b/libc/sysdeps/linux/common/bits/kernel-features.h |
1178 |
-@@ -495,6 +495,14 @@ |
1179 |
- # define __ASSUME_PRIVATE_FUTEX 1 |
1180 |
- #endif |
1181 |
- |
1182 |
-+/* Support for fallocate was added in 2.6.23, |
1183 |
-+ on s390 only after 2.6.23-rc1, on alpha only after 2.6.33-rc1. */ |
1184 |
-+#if __LINUX_KERNEL_VERSION >= 0x020617 \ |
1185 |
-+ && (!defined __s390__ || __LINUX_KERNEL_VERSION >= 0x020618) \ |
1186 |
-+ && (!defined __alpha__ || __LINUX_KERNEL_VERSION >= 0x020621) |
1187 |
-+# define __ASSUME_FALLOCATE 1 |
1188 |
-+#endif |
1189 |
-+ |
1190 |
- /* getcpu is a syscall for x86-64 since 3.1. */ |
1191 |
- #if defined __x86_64__ && __LINUX_KERNEL_VERSION >= 0x030100 |
1192 |
- # define __ASSUME_GETCPU_SYSCALL 1 |
1193 |
-diff --git a/libc/sysdeps/linux/common/posix_fallocate.c b/libc/sysdeps/linux/common/posix_fallocate.c |
1194 |
-new file mode 100644 |
1195 |
-index 0000000..9aaa6ce |
1196 |
---- /dev/null |
1197 |
-+++ b/libc/sysdeps/linux/common/posix_fallocate.c |
1198 |
-@@ -0,0 +1,43 @@ |
1199 |
-+/* vi: set sw=4 ts=4: */ |
1200 |
-+/* |
1201 |
-+ * posix_fallocate() for uClibc |
1202 |
-+ * http://www.opengroup.org/onlinepubs/9699919799/functions/posix_fallocate.html |
1203 |
-+ * |
1204 |
-+ * Copyright (C) 2000-2006 Erik Andersen <andersen@××××××.org> |
1205 |
-+ * |
1206 |
-+ * Licensed under the LGPL v2.1 or later, see the file COPYING.LIB in this tarball. |
1207 |
-+ */ |
1208 |
-+ |
1209 |
-+#include <sys/syscall.h> |
1210 |
-+#include <fcntl.h> |
1211 |
-+#include <bits/kernel-features.h> |
1212 |
-+#include <stdint.h> |
1213 |
-+ |
1214 |
-+#if defined __NR_fallocate |
1215 |
-+int posix_fallocate(int fd, __off_t offset, __off_t len) |
1216 |
-+{ |
1217 |
-+ int ret; |
1218 |
-+ |
1219 |
-+# if __WORDSIZE == 32 |
1220 |
-+ uint32_t off_low = offset; |
1221 |
-+ uint32_t len_low = len; |
1222 |
-+ /* may assert that these >>31 are 0 */ |
1223 |
-+ uint32_t zero = 0; |
1224 |
-+ INTERNAL_SYSCALL_DECL(err); |
1225 |
-+ ret = (int) (INTERNAL_SYSCALL(fallocate, err, 6, fd, 0, |
1226 |
-+ __LONG_LONG_PAIR (zero, off_low), |
1227 |
-+ __LONG_LONG_PAIR (zero, len_low))); |
1228 |
-+# elif __WORDSIZE == 64 |
1229 |
-+ INTERNAL_SYSCALL_DECL(err); |
1230 |
-+ ret = (int) (INTERNAL_SYSCALL(fallocate, err, 4, fd, 0, offset, len)); |
1231 |
-+# else |
1232 |
-+# error your machine is neither 32 bit or 64 bit ... it must be magical |
1233 |
-+#endif |
1234 |
-+ if (unlikely(INTERNAL_SYSCALL_ERROR_P (ret, err))) |
1235 |
-+ return INTERNAL_SYSCALL_ERRNO (ret, err); |
1236 |
-+ return 0; |
1237 |
-+} |
1238 |
-+# if defined __UCLIBC_HAS_LFS__ && __WORDSIZE == 64 |
1239 |
-+strong_alias(posix_fallocate,posix_fallocate64) |
1240 |
-+# endif |
1241 |
-+#endif |
1242 |
-diff --git a/libc/sysdeps/linux/common/posix_fallocate64.c b/libc/sysdeps/linux/common/posix_fallocate64.c |
1243 |
-new file mode 100644 |
1244 |
-index 0000000..818d868 |
1245 |
---- /dev/null |
1246 |
-+++ b/libc/sysdeps/linux/common/posix_fallocate64.c |
1247 |
-@@ -0,0 +1,39 @@ |
1248 |
-+/* vi: set sw=4 ts=4: */ |
1249 |
-+/* |
1250 |
-+ * posix_fallocate() for uClibc |
1251 |
-+ * http://www.opengroup.org/onlinepubs/9699919799/functions/posix_fallocate.html |
1252 |
-+ * |
1253 |
-+ * Copyright (C) 2000-2006 Erik Andersen <andersen@××××××.org> |
1254 |
-+ * |
1255 |
-+ * Licensed under the LGPL v2.1 or later, see the file COPYING.LIB in this tarball. |
1256 |
-+ */ |
1257 |
-+ |
1258 |
-+#include <sys/syscall.h> |
1259 |
-+#include <fcntl.h> |
1260 |
-+#include <bits/kernel-features.h> |
1261 |
-+#include <stdint.h> |
1262 |
-+ |
1263 |
-+#if defined __NR_fallocate |
1264 |
-+ |
1265 |
-+# if __WORDSIZE == 64 |
1266 |
-+/* Can use normal posix_fallocate() */ |
1267 |
-+# elif __WORDSIZE == 32 |
1268 |
-+int posix_fallocate64(int fd, __off64_t offset, __off64_t len) |
1269 |
-+{ |
1270 |
-+ int ret; |
1271 |
-+ uint32_t off_low = offset & 0xffffffff; |
1272 |
-+ uint32_t off_high = offset >> 32; |
1273 |
-+ uint32_t len_low = len & 0xffffffff; |
1274 |
-+ uint32_t len_high = len >> 32; |
1275 |
-+ INTERNAL_SYSCALL_DECL(err); |
1276 |
-+ ret = (int) (INTERNAL_SYSCALL(fallocate, err, 6, fd, 0, |
1277 |
-+ __LONG_LONG_PAIR (off_high, off_low), |
1278 |
-+ __LONG_LONG_PAIR (len_high, len_low))); |
1279 |
-+ if (unlikely(INTERNAL_SYSCALL_ERROR_P (ret, err))) |
1280 |
-+ return INTERNAL_SYSCALL_ERRNO (ret, err); |
1281 |
-+ return 0; |
1282 |
-+} |
1283 |
-+# else |
1284 |
-+# error your machine is neither 32 bit or 64 bit ... it must be magical |
1285 |
-+# endif |
1286 |
-+#endif |
1287 |
-diff --git a/test/.gitignore b/test/.gitignore |
1288 |
-index c068f89..ec04628 100644 |
1289 |
---- a/test/.gitignore |
1290 |
-+++ b/test/.gitignore |
1291 |
-@@ -319,6 +319,8 @@ unistd/getcwd |
1292 |
- unistd/getopt |
1293 |
- unistd/getopt_long |
1294 |
- unistd/tstgetopt |
1295 |
-+unistd/tst-posix_fallocate |
1296 |
-+unistd/tst-posix_fallocate64 |
1297 |
- unistd/tst-preadwrite |
1298 |
- unistd/tst-preadwrite64 |
1299 |
- unistd/vfork |
1300 |
-diff --git a/test/unistd/Makefile.in b/test/unistd/Makefile.in |
1301 |
-index c542f98..24b9a37 100644 |
1302 |
---- a/test/unistd/Makefile.in |
1303 |
-+++ b/test/unistd/Makefile.in |
1304 |
-@@ -2,7 +2,10 @@ |
1305 |
- # Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball. |
1306 |
- |
1307 |
- ifeq ($(UCLIBC_HAS_LFS),) |
1308 |
--TESTS_DISABLED := tst-preadwrite64 |
1309 |
-+TESTS_DISABLED := tst-preadwrite64 tst-posix_fallocate64 |
1310 |
-+endif |
1311 |
-+ifeq ($(UCLIBC_HAS_ADVANCED_REALTIME),) |
1312 |
-+TESTS_DISABLED := tst-posix_fallocate |
1313 |
- endif |
1314 |
- OPTS_getopt := -abcXXX -9 |
1315 |
- OPTS_getopt_long := --add XXX --delete YYY --verbose |
1316 |
-diff --git a/test/unistd/tst-posix_fallocate.c b/test/unistd/tst-posix_fallocate.c |
1317 |
-new file mode 100644 |
1318 |
-index 0000000..d41c604 |
1319 |
---- /dev/null |
1320 |
-+++ b/test/unistd/tst-posix_fallocate.c |
1321 |
-@@ -0,0 +1,127 @@ |
1322 |
-+#include <fcntl.h> |
1323 |
-+#include <sys/stat.h> |
1324 |
-+ |
1325 |
-+#ifndef TST_POSIX_FALLOCATE64 |
1326 |
-+# define stat64 stat |
1327 |
-+# define fstat64 fstat |
1328 |
-+# else |
1329 |
-+# ifndef O_LARGEFILE |
1330 |
-+# error no O_LARGEFILE but you want to test with LFS enabled |
1331 |
-+# endif |
1332 |
-+#endif |
1333 |
-+ |
1334 |
-+static void do_prepare (void); |
1335 |
-+#define PREPARE(argc, argv) do_prepare () |
1336 |
-+static int do_test (void); |
1337 |
-+#define TEST_FUNCTION do_test () |
1338 |
-+#include <test-skeleton.c> |
1339 |
-+ |
1340 |
-+static int fd; |
1341 |
-+static void |
1342 |
-+do_prepare (void) |
1343 |
-+{ |
1344 |
-+ fd = create_temp_file ("tst-posix_fallocate.", NULL); |
1345 |
-+ if (fd == -1) |
1346 |
-+ { |
1347 |
-+ printf ("cannot create temporary file: %m\n"); |
1348 |
-+ exit (1); |
1349 |
-+ } |
1350 |
-+} |
1351 |
-+ |
1352 |
-+ |
1353 |
-+static int |
1354 |
-+do_test (void) |
1355 |
-+{ |
1356 |
-+ struct stat64 st; |
1357 |
-+ |
1358 |
-+ if (fstat64 (fd, &st) != 0) |
1359 |
-+ { |
1360 |
-+ puts ("1st fstat failed"); |
1361 |
-+ return 1; |
1362 |
-+ } |
1363 |
-+ |
1364 |
-+ if (st.st_size != 0) |
1365 |
-+ { |
1366 |
-+ puts ("file not created with size 0"); |
1367 |
-+ return 1; |
1368 |
-+ } |
1369 |
-+ |
1370 |
-+ if (posix_fallocate (fd, 512, 768) != 0) |
1371 |
-+ { |
1372 |
-+ puts ("1st posix_fallocate call failed"); |
1373 |
-+ return 1; |
1374 |
-+ } |
1375 |
-+ |
1376 |
-+ if (fstat64 (fd, &st) != 0) |
1377 |
-+ { |
1378 |
-+ puts ("2nd fstat failed"); |
1379 |
-+ return 1; |
1380 |
-+ } |
1381 |
-+ |
1382 |
-+ if (st.st_size != 512 + 768) |
1383 |
-+ { |
1384 |
-+ printf ("file size after 1st posix_fallocate call is %llu, expected %u\n", |
1385 |
-+ (unsigned long long int) st.st_size, 512u + 768u); |
1386 |
-+ return 1; |
1387 |
-+ } |
1388 |
-+ |
1389 |
-+ if (posix_fallocate (fd, 0, 1024) != 0) |
1390 |
-+ { |
1391 |
-+ puts ("2nd posix_fallocate call failed"); |
1392 |
-+ return 1; |
1393 |
-+ } |
1394 |
-+ |
1395 |
-+ if (fstat64 (fd, &st) != 0) |
1396 |
-+ { |
1397 |
-+ puts ("3rd fstat failed"); |
1398 |
-+ return 1; |
1399 |
-+ } |
1400 |
-+ |
1401 |
-+ if (st.st_size != 512 + 768) |
1402 |
-+ { |
1403 |
-+ puts ("file size changed in 2nd posix_fallocate"); |
1404 |
-+ return 1; |
1405 |
-+ } |
1406 |
-+ |
1407 |
-+ if (posix_fallocate (fd, 2048, 64) != 0) |
1408 |
-+ { |
1409 |
-+ puts ("3rd posix_fallocate call failed"); |
1410 |
-+ return 1; |
1411 |
-+ } |
1412 |
-+ |
1413 |
-+ if (fstat64 (fd, &st) != 0) |
1414 |
-+ { |
1415 |
-+ puts ("4th fstat failed"); |
1416 |
-+ return 1; |
1417 |
-+ } |
1418 |
-+ |
1419 |
-+ if (st.st_size != 2048 + 64) |
1420 |
-+ { |
1421 |
-+ printf ("file size after 3rd posix_fallocate call is %llu, expected %u\n", |
1422 |
-+ (unsigned long long int) st.st_size, 2048u + 64u); |
1423 |
-+ return 1; |
1424 |
-+ } |
1425 |
-+#ifdef TST_POSIX_FALLOCATE64 |
1426 |
-+ if (posix_fallocate64 (fd, 4097ULL, 4294967295ULL + 2ULL) != 0) |
1427 |
-+ { |
1428 |
-+ puts ("4th posix_fallocate call failed"); |
1429 |
-+ return 1; |
1430 |
-+ } |
1431 |
-+ |
1432 |
-+ if (fstat64 (fd, &st) != 0) |
1433 |
-+ { |
1434 |
-+ puts ("5th fstat failed"); |
1435 |
-+ return 1; |
1436 |
-+ } |
1437 |
-+ |
1438 |
-+ if (st.st_size != 4097ULL + 4294967295ULL + 2ULL) |
1439 |
-+ { |
1440 |
-+ printf ("file size after 4th posix_fallocate call is %llu, expected %llu\n", |
1441 |
-+ (unsigned long long int) st.st_size, 4097ULL + 4294967295ULL + 2ULL); |
1442 |
-+ return 1; |
1443 |
-+ } |
1444 |
-+#endif |
1445 |
-+ close (fd); |
1446 |
-+ |
1447 |
-+ return 0; |
1448 |
-+} |
1449 |
-diff --git a/test/unistd/tst-posix_fallocate64.c b/test/unistd/tst-posix_fallocate64.c |
1450 |
-new file mode 100644 |
1451 |
-index 0000000..b1ee0ff |
1452 |
---- /dev/null |
1453 |
-+++ b/test/unistd/tst-posix_fallocate64.c |
1454 |
-@@ -0,0 +1,2 @@ |
1455 |
-+#define TST_POSIX_FALLOCATE64 |
1456 |
-+#include "tst-posix_fallocate.c" |
1457 |
--- |
1458 |
-cgit v0.9.1 |
1459 |
|
1460 |
diff --git a/tools-uclibc/portage.mipsel3.vanilla/savedconfig/sys-libs/uclibc-0.9.33.2-r3 b/tools-uclibc/portage.mipsel3.vanilla/savedconfig/sys-libs/uclibc-0.9.33.2-r4 |
1461 |
similarity index 100% |
1462 |
rename from tools-uclibc/portage.mipsel3.vanilla/savedconfig/sys-libs/uclibc-0.9.33.2-r3 |
1463 |
rename to tools-uclibc/portage.mipsel3.vanilla/savedconfig/sys-libs/uclibc-0.9.33.2-r4 |