bump version
[buildroot.git] / toolchain / uClibc / uClibc.057-sync_page_range.diff
blob9f1763fa85e5eba262c86812e18a5b8764e43ad4
1 Index: uClibc/libc/sysdeps/linux/common/Makefile.in
2 ===================================================================
3 --- uClibc/libc/sysdeps/linux/common/Makefile.in (revision 23383)
4 +++ uClibc/libc/sysdeps/linux/common/Makefile.in (working copy)
5 @@ -35,8 +35,8 @@ CSRC := $(filter-out inotify.c ioperm.c
6 modify_ldt.c personality.c prctl.c readahead.c reboot.c \
7 remap_file_pages.c sched_getaffinity.c sched_setaffinity.c \
8 sendfile64.c sendfile.c setfsgid.c setfsuid.c setresuid.c \
9 - splice.c vmsplice.c tee.c swapoff.c swapon.c sysctl.c sysinfo.c \
10 - uselib.c vhangup.c,$(CSRC))
11 + splice.c vmsplice.c tee.c swapoff.c swapon.c sync_file_range.c \
12 + sysctl.c sysinfo.c uselib.c vhangup.c,$(CSRC))
13 endif
15 ifneq ($(UCLIBC_BSD_SPECIFIC),y)
16 Index: uClibc/libc/sysdeps/linux/common/sync_file_range.c
17 ===================================================================
18 --- uClibc/libc/sysdeps/linux/common/sync_file_range.c (revision 0)
19 +++ uClibc/libc/sysdeps/linux/common/sync_file_range.c (revision 0)
20 @@ -0,0 +1,34 @@
21 +/* vi: set sw=4 ts=4: */
22 +/*
23 + * sync_file_range() for uClibc
24 + *
25 + * Copyright (C) 2008 Bernhard Reutner-Fischer <uclibc@uclibc.org>
26 + *
27 + * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
28 + */
29 +#include <features.h>
30 +#include <sys/syscall.h>
31 +#if defined __USE_GNU
32 +#include <fcntl.h>
34 +#if defined __NR_sync_file_range && defined __UCLIBC_HAS_LFS__
35 +#define __NR___syscall_sync_file_range __NR_sync_file_range
37 +static __inline__ _syscall6(int, __syscall_sync_file_range, int, fd,
38 + off_t, from_hi, off_t, from_lo,
39 + off_t, to_hi, off_t, to_lo, unsigned int, flags);
40 +int sync_file_range(int fd, off64_t from, off64_t to, unsigned int flags)
42 + return __syscall_sync_file_range(fd,
43 + __LONG_LONG_PAIR((long)(from >> 32), (long)(from & 0xffffffff)),
44 + __LONG_LONG_PAIR((long)(to >> 32), (long)(to & 0xffffffff)),
45 + flags);
47 +#elif defined __UCLIBC_HAS_STUBS__
48 +int sync_file_range(int fd, off64_t from, off64_t to, unsigned int flags)
50 + __set_errno(ENOSYS);
51 + return -1;
53 +#endif
54 +#endif
55 Index: uClibc/libc/sysdeps/linux/alpha/bits/fcntl.h
56 ===================================================================
57 --- uClibc/libc/sysdeps/linux/alpha/bits/fcntl.h (revision 23383)
58 +++ uClibc/libc/sysdeps/linux/alpha/bits/fcntl.h (working copy)
59 @@ -182,7 +182,6 @@ struct flock64
62 #ifdef __USE_GNU
63 -#if 0
64 /* Flags for SYNC_FILE_RANGE. */
65 # define SYNC_FILE_RANGE_WAIT_BEFORE 1 /* Wait upon writeout of all pages
66 in the range before performing the
67 @@ -193,7 +192,6 @@ struct flock64
68 # define SYNC_FILE_RANGE_WAIT_AFTER 4 /* Wait upon writeout of all pages in
69 the range after performing the
70 write. */
71 -#endif
73 /* Flags for SPLICE and VMSPLICE. */
74 # define SPLICE_F_MOVE 1 /* Move pages instead of copying. */
75 @@ -213,11 +211,9 @@ extern ssize_t readahead (int __fd, __of
76 __THROW;
79 -#if 0
80 /* Selective file content synch'ing. */
81 extern int sync_file_range (int __fd, __off64_t __from, __off64_t __to,
82 unsigned int __flags);
83 -#endif
85 /* Splice address range into a pipe. */
86 extern ssize_t vmsplice (int __fdout, const struct iovec *__iov,
87 Index: uClibc/libc/sysdeps/linux/arm/bits/fcntl.h
88 ===================================================================
89 --- uClibc/libc/sysdeps/linux/arm/bits/fcntl.h (revision 23383)
90 +++ uClibc/libc/sysdeps/linux/arm/bits/fcntl.h (working copy)
91 @@ -190,7 +190,6 @@ struct flock64
94 #ifdef __USE_GNU
95 -#if 0
96 /* Flags for SYNC_FILE_RANGE. */
97 # define SYNC_FILE_RANGE_WAIT_BEFORE 1 /* Wait upon writeout of all pages
98 in the range before performing the
99 @@ -201,7 +200,6 @@ struct flock64
100 # define SYNC_FILE_RANGE_WAIT_AFTER 4 /* Wait upon writeout of all pages in
101 the range after performing the
102 write. */
103 -#endif
105 /* Flags for SPLICE and VMSPLICE. */
106 # define SPLICE_F_MOVE 1 /* Move pages instead of copying. */
107 @@ -220,11 +218,9 @@ __BEGIN_DECLS
108 extern ssize_t readahead (int __fd, __off64_t __offset, size_t __count)
109 __THROW;
111 -#if 0
112 /* Selective file content synch'ing. */
113 extern int sync_file_range (int __fd, __off64_t __from, __off64_t __to,
114 unsigned int __flags);
115 -#endif
117 /* Splice address range into a pipe. */
118 extern ssize_t vmsplice (int __fdout, const struct iovec *__iov,
119 Index: uClibc/libc/sysdeps/linux/bfin/bits/fcntl.h
120 ===================================================================
121 --- uClibc/libc/sysdeps/linux/bfin/bits/fcntl.h (revision 23383)
122 +++ uClibc/libc/sysdeps/linux/bfin/bits/fcntl.h (working copy)
123 @@ -186,7 +186,6 @@ struct flock64
126 #ifdef __USE_GNU
127 -#if 0
128 /* Flags for SYNC_FILE_RANGE. */
129 # define SYNC_FILE_RANGE_WAIT_BEFORE 1 /* Wait upon writeout of all pages
130 in the range before performing the
131 @@ -197,7 +196,6 @@ struct flock64
132 # define SYNC_FILE_RANGE_WAIT_AFTER 4 /* Wait upon writeout of all pages in
133 the range after performing the
134 write. */
135 -#endif
137 /* Flags for SPLICE and VMSPLICE. */
138 # define SPLICE_F_MOVE 1 /* Move pages instead of copying. */
139 @@ -217,11 +215,9 @@ extern ssize_t readahead (int __fd, __of
140 __THROW;
143 -#if 0
144 /* Selective file content synch'ing. */
145 extern int sync_file_range (int __fd, __off64_t __from, __off64_t __to,
146 unsigned int __flags);
147 -#endif
149 /* Splice address range into a pipe. */
150 extern ssize_t vmsplice (int __fdout, const struct iovec *__iov,
151 Index: uClibc/libc/sysdeps/linux/cris/bits/fcntl.h
152 ===================================================================
153 --- uClibc/libc/sysdeps/linux/cris/bits/fcntl.h (revision 23383)
154 +++ uClibc/libc/sysdeps/linux/cris/bits/fcntl.h (working copy)
155 @@ -187,7 +187,6 @@ struct flock64
158 #ifdef __USE_GNU
159 -#if 0
160 /* Flags for SYNC_FILE_RANGE. */
161 # define SYNC_FILE_RANGE_WAIT_BEFORE 1 /* Wait upon writeout of all pages
162 in the range before performing the
163 @@ -198,7 +197,6 @@ struct flock64
164 # define SYNC_FILE_RANGE_WAIT_AFTER 4 /* Wait upon writeout of all pages in
165 the range after performing the
166 write. */
167 -#endif
169 /* Flags for SPLICE and VMSPLICE. */
170 # define SPLICE_F_MOVE 1 /* Move pages instead of copying. */
171 @@ -218,11 +216,9 @@ extern ssize_t readahead (int __fd, __of
172 __THROW;
175 -#if 0
176 /* Selective file content synch'ing. */
177 extern int sync_file_range (int __fd, __off64_t __from, __off64_t __to,
178 unsigned int __flags);
179 -#endif
181 /* Splice address range into a pipe. */
182 extern ssize_t vmsplice (int __fdout, const struct iovec *__iov,
183 Index: uClibc/libc/sysdeps/linux/e1/bits/fcntl.h
184 ===================================================================
185 --- uClibc/libc/sysdeps/linux/e1/bits/fcntl.h (revision 23383)
186 +++ uClibc/libc/sysdeps/linux/e1/bits/fcntl.h (working copy)
187 @@ -183,7 +183,6 @@ struct flock64
190 #ifdef __USE_GNU
191 -#if 0
192 /* Flags for SYNC_FILE_RANGE. */
193 # define SYNC_FILE_RANGE_WAIT_BEFORE 1 /* Wait upon writeout of all pages
194 in the range before performing the
195 @@ -194,7 +193,6 @@ struct flock64
196 # define SYNC_FILE_RANGE_WAIT_AFTER 4 /* Wait upon writeout of all pages in
197 the range after performing the
198 write. */
199 -#endif
201 /* Flags for SPLICE and VMSPLICE. */
202 # define SPLICE_F_MOVE 1 /* Move pages instead of copying. */
203 @@ -214,11 +212,9 @@ extern ssize_t readahead (int __fd, __of
204 __THROW;
207 -#if 0
208 /* Selective file content synch'ing. */
209 extern int sync_file_range (int __fd, __off64_t __from, __off64_t __to,
210 unsigned int __flags);
211 -#endif
213 /* Splice address range into a pipe. */
214 extern ssize_t vmsplice (int __fdout, const struct iovec *__iov,
215 Index: uClibc/libc/sysdeps/linux/frv/bits/fcntl.h
216 ===================================================================
217 --- uClibc/libc/sysdeps/linux/frv/bits/fcntl.h (revision 23383)
218 +++ uClibc/libc/sysdeps/linux/frv/bits/fcntl.h (working copy)
219 @@ -165,7 +165,6 @@ struct flock64
222 #ifdef __USE_GNU
223 -#if 0
224 /* Flags for SYNC_FILE_RANGE. */
225 # define SYNC_FILE_RANGE_WAIT_BEFORE 1 /* Wait upon writeout of all pages
226 in the range before performing the
227 @@ -176,7 +175,6 @@ struct flock64
228 # define SYNC_FILE_RANGE_WAIT_AFTER 4 /* Wait upon writeout of all pages in
229 the range after performing the
230 write. */
231 -#endif
233 /* Flags for SPLICE and VMSPLICE. */
234 # define SPLICE_F_MOVE 1 /* Move pages instead of copying. */
235 @@ -196,11 +194,9 @@ extern ssize_t readahead (int __fd, __of
236 __THROW;
239 -#if 0
240 /* Selective file content synch'ing. */
241 extern int sync_file_range (int __fd, __off64_t __from, __off64_t __to,
242 unsigned int __flags);
243 -#endif
245 /* Splice address range into a pipe. */
246 extern ssize_t vmsplice (int __fdout, const struct iovec *__iov,
247 Index: uClibc/libc/sysdeps/linux/h8300/bits/fcntl.h
248 ===================================================================
249 --- uClibc/libc/sysdeps/linux/h8300/bits/fcntl.h (revision 23383)
250 +++ uClibc/libc/sysdeps/linux/h8300/bits/fcntl.h (working copy)
251 @@ -183,7 +183,6 @@ struct flock64
254 #ifdef __USE_GNU
255 -#if 0
256 /* Flags for SYNC_FILE_RANGE. */
257 # define SYNC_FILE_RANGE_WAIT_BEFORE 1 /* Wait upon writeout of all pages
258 in the range before performing the
259 @@ -194,7 +193,6 @@ struct flock64
260 # define SYNC_FILE_RANGE_WAIT_AFTER 4 /* Wait upon writeout of all pages in
261 the range after performing the
262 write. */
263 -#endif
265 /* Flags for SPLICE and VMSPLICE. */
266 # define SPLICE_F_MOVE 1 /* Move pages instead of copying. */
267 @@ -214,11 +212,9 @@ extern ssize_t readahead (int __fd, __of
268 __THROW;
271 -#if 0
272 /* Selective file content synch'ing. */
273 extern int sync_file_range (int __fd, __off64_t __from, __off64_t __to,
274 unsigned int __flags);
275 -#endif
277 /* Splice address range into a pipe. */
278 extern ssize_t vmsplice (int __fdout, const struct iovec *__iov,
279 Index: uClibc/libc/sysdeps/linux/hppa/bits/fcntl.h
280 ===================================================================
281 --- uClibc/libc/sysdeps/linux/hppa/bits/fcntl.h (revision 23383)
282 +++ uClibc/libc/sysdeps/linux/hppa/bits/fcntl.h (working copy)
283 @@ -177,7 +177,6 @@ struct flock64
286 #ifdef __USE_GNU
287 -#if 0
288 /* Flags for SYNC_FILE_RANGE. */
289 # define SYNC_FILE_RANGE_WAIT_BEFORE 1 /* Wait upon writeout of all pages
290 in the range before performing the
291 @@ -188,7 +187,6 @@ struct flock64
292 # define SYNC_FILE_RANGE_WAIT_AFTER 4 /* Wait upon writeout of all pages in
293 the range after performing the
294 write. */
295 -#endif
297 /* Flags for SPLICE and VMSPLICE. */
298 # define SPLICE_F_MOVE 1 /* Move pages instead of copying. */
299 @@ -208,11 +206,9 @@ extern ssize_t readahead (int __fd, __of
300 __THROW;
303 -#if 0
304 /* Selective file content synch'ing. */
305 extern int sync_file_range (int __fd, __off64_t __from, __off64_t __to,
306 unsigned int __flags);
307 -#endif
309 /* Splice address range into a pipe. */
310 extern ssize_t vmsplice (int __fdout, const struct iovec *__iov,
311 Index: uClibc/libc/sysdeps/linux/i386/bits/fcntl.h
312 ===================================================================
313 --- uClibc/libc/sysdeps/linux/i386/bits/fcntl.h (revision 23383)
314 +++ uClibc/libc/sysdeps/linux/i386/bits/fcntl.h (working copy)
315 @@ -190,7 +190,6 @@ struct flock64
318 #ifdef __USE_GNU
319 -#if 0
320 /* Flags for SYNC_FILE_RANGE. */
321 # define SYNC_FILE_RANGE_WAIT_BEFORE 1 /* Wait upon writeout of all pages
322 in the range before performing the
323 @@ -201,7 +200,6 @@ struct flock64
324 # define SYNC_FILE_RANGE_WAIT_AFTER 4 /* Wait upon writeout of all pages in
325 the range after performing the
326 write. */
327 -#endif
329 /* Flags for SPLICE and VMSPLICE. */
330 # define SPLICE_F_MOVE 1 /* Move pages instead of copying. */
331 @@ -221,11 +219,9 @@ extern ssize_t readahead (int __fd, __of
332 __THROW;
335 -#if 0
336 /* Selective file content synch'ing. */
337 extern int sync_file_range (int __fd, __off64_t __from, __off64_t __to,
338 unsigned int __flags);
339 -#endif
341 /* Splice address range into a pipe. */
342 extern ssize_t vmsplice (int __fdout, const struct iovec *__iov,
343 Index: uClibc/libc/sysdeps/linux/i960/bits/fcntl.h
344 ===================================================================
345 --- uClibc/libc/sysdeps/linux/i960/bits/fcntl.h (revision 23383)
346 +++ uClibc/libc/sysdeps/linux/i960/bits/fcntl.h (working copy)
347 @@ -183,7 +183,6 @@ struct flock64
350 #ifdef __USE_GNU
351 -#if 0
352 /* Flags for SYNC_FILE_RANGE. */
353 # define SYNC_FILE_RANGE_WAIT_BEFORE 1 /* Wait upon writeout of all pages
354 in the range before performing the
355 @@ -194,7 +193,6 @@ struct flock64
356 # define SYNC_FILE_RANGE_WAIT_AFTER 4 /* Wait upon writeout of all pages in
357 the range after performing the
358 write. */
359 -#endif
361 /* Flags for SPLICE and VMSPLICE. */
362 # define SPLICE_F_MOVE 1 /* Move pages instead of copying. */
363 @@ -214,11 +212,9 @@ extern ssize_t readahead (int __fd, __of
364 __THROW;
367 -#if 0
368 /* Selective file content synch'ing. */
369 extern int sync_file_range (int __fd, __off64_t __from, __off64_t __to,
370 unsigned int __flags);
371 -#endif
373 /* Splice address range into a pipe. */
374 extern ssize_t vmsplice (int __fdout, const struct iovec *__iov,
375 Index: uClibc/libc/sysdeps/linux/ia64/bits/fcntl.h
376 ===================================================================
377 --- uClibc/libc/sysdeps/linux/ia64/bits/fcntl.h (revision 23383)
378 +++ uClibc/libc/sysdeps/linux/ia64/bits/fcntl.h (working copy)
379 @@ -184,7 +184,6 @@ struct flock64
382 #ifdef __USE_GNU
383 -#if 0
384 /* Flags for SYNC_FILE_RANGE. */
385 # define SYNC_FILE_RANGE_WAIT_BEFORE 1 /* Wait upon writeout of all pages
386 in the range before performing the
387 @@ -195,7 +194,6 @@ struct flock64
388 # define SYNC_FILE_RANGE_WAIT_AFTER 4 /* Wait upon writeout of all pages in
389 the range after performing the
390 write. */
391 -#endif
393 /* Flags for SPLICE and VMSPLICE. */
394 # define SPLICE_F_MOVE 1 /* Move pages instead of copying. */
395 @@ -215,11 +213,9 @@ extern ssize_t readahead (int __fd, __of
396 __THROW;
399 -#if 0
400 /* Selective file content synch'ing. */
401 extern int sync_file_range (int __fd, __off64_t __from, __off64_t __to,
402 unsigned int __flags);
403 -#endif
405 /* Splice address range into a pipe. */
406 extern ssize_t vmsplice (int __fdout, const struct iovec *__iov,
407 Index: uClibc/libc/sysdeps/linux/m68k/bits/fcntl.h
408 ===================================================================
409 --- uClibc/libc/sysdeps/linux/m68k/bits/fcntl.h (revision 23383)
410 +++ uClibc/libc/sysdeps/linux/m68k/bits/fcntl.h (working copy)
411 @@ -186,7 +186,6 @@ struct flock64
414 #ifdef __USE_GNU
415 -#if 0
416 /* Flags for SYNC_FILE_RANGE. */
417 # define SYNC_FILE_RANGE_WAIT_BEFORE 1 /* Wait upon writeout of all pages
418 in the range before performing the
419 @@ -197,7 +196,6 @@ struct flock64
420 # define SYNC_FILE_RANGE_WAIT_AFTER 4 /* Wait upon writeout of all pages in
421 the range after performing the
422 write. */
423 -#endif
425 /* Flags for SPLICE and VMSPLICE. */
426 # define SPLICE_F_MOVE 1 /* Move pages instead of copying. */
427 @@ -217,11 +215,9 @@ extern ssize_t readahead (int __fd, __of
428 __THROW;
431 -#if 0
432 /* Selective file content synch'ing. */
433 extern int sync_file_range (int __fd, __off64_t __from, __off64_t __to,
434 unsigned int __flags);
435 -#endif
437 /* Splice address range into a pipe. */
438 extern ssize_t vmsplice (int __fdout, const struct iovec *__iov,
439 Index: uClibc/libc/sysdeps/linux/microblaze/bits/fcntl.h
440 ===================================================================
441 --- uClibc/libc/sysdeps/linux/microblaze/bits/fcntl.h (revision 23383)
442 +++ uClibc/libc/sysdeps/linux/microblaze/bits/fcntl.h (working copy)
443 @@ -183,7 +183,6 @@ struct flock64
446 #ifdef __USE_GNU
447 -#if 0
448 /* Flags for SYNC_FILE_RANGE. */
449 # define SYNC_FILE_RANGE_WAIT_BEFORE 1 /* Wait upon writeout of all pages
450 in the range before performing the
451 @@ -194,7 +193,6 @@ struct flock64
452 # define SYNC_FILE_RANGE_WAIT_AFTER 4 /* Wait upon writeout of all pages in
453 the range after performing the
454 write. */
455 -#endif
457 /* Flags for SPLICE and VMSPLICE. */
458 # define SPLICE_F_MOVE 1 /* Move pages instead of copying. */
459 @@ -214,11 +212,9 @@ extern ssize_t readahead (int __fd, __of
460 __THROW;
463 -#if 0
464 /* Selective file content synch'ing. */
465 extern int sync_file_range (int __fd, __off64_t __from, __off64_t __to,
466 unsigned int __flags);
467 -#endif
469 /* Splice address range into a pipe. */
470 extern ssize_t vmsplice (int __fdout, const struct iovec *__iov,
471 Index: uClibc/libc/sysdeps/linux/mips/bits/fcntl.h
472 ===================================================================
473 --- uClibc/libc/sysdeps/linux/mips/bits/fcntl.h (revision 23383)
474 +++ uClibc/libc/sysdeps/linux/mips/bits/fcntl.h (working copy)
475 @@ -210,7 +210,6 @@ struct flock64
478 #ifdef __USE_GNU
479 -#if 0
480 /* Flags for SYNC_FILE_RANGE. */
481 # define SYNC_FILE_RANGE_WAIT_BEFORE 1 /* Wait upon writeout of all pages
482 in the range before performing the
483 @@ -221,7 +220,6 @@ struct flock64
484 # define SYNC_FILE_RANGE_WAIT_AFTER 4 /* Wait upon writeout of all pages in
485 the range after performing the
486 write. */
487 -#endif
489 /* Flags for SPLICE and VMSPLICE. */
490 # define SPLICE_F_MOVE 1 /* Move pages instead of copying. */
491 @@ -241,11 +239,9 @@ extern ssize_t readahead (int __fd, __of
492 __THROW;
495 -#if 0
496 /* Selective file content synch'ing. */
497 extern int sync_file_range (int __fd, __off64_t __from, __off64_t __to,
498 unsigned int __flags);
499 -#endif
501 /* Splice address range into a pipe. */
502 extern ssize_t vmsplice (int __fdout, const struct iovec *__iov,
503 Index: uClibc/libc/sysdeps/linux/nios2/bits/fcntl.h
504 ===================================================================
505 --- uClibc/libc/sysdeps/linux/nios2/bits/fcntl.h (revision 23383)
506 +++ uClibc/libc/sysdeps/linux/nios2/bits/fcntl.h (working copy)
507 @@ -186,7 +186,6 @@ struct flock64
510 #ifdef __USE_GNU
511 -#if 0
512 /* Flags for SYNC_FILE_RANGE. */
513 # define SYNC_FILE_RANGE_WAIT_BEFORE 1 /* Wait upon writeout of all pages
514 in the range before performing the
515 @@ -197,7 +196,6 @@ struct flock64
516 # define SYNC_FILE_RANGE_WAIT_AFTER 4 /* Wait upon writeout of all pages in
517 the range after performing the
518 write. */
519 -#endif
521 /* Flags for SPLICE and VMSPLICE. */
522 # define SPLICE_F_MOVE 1 /* Move pages instead of copying. */
523 @@ -217,11 +215,9 @@ extern ssize_t readahead (int __fd, __of
524 __THROW;
527 -#if 0
528 /* Selective file content synch'ing. */
529 extern int sync_file_range (int __fd, __off64_t __from, __off64_t __to,
530 unsigned int __flags);
531 -#endif
533 /* Splice address range into a pipe. */
534 extern ssize_t vmsplice (int __fdout, const struct iovec *__iov,
535 Index: uClibc/libc/sysdeps/linux/nios/bits/fcntl.h
536 ===================================================================
537 --- uClibc/libc/sysdeps/linux/nios/bits/fcntl.h (revision 23383)
538 +++ uClibc/libc/sysdeps/linux/nios/bits/fcntl.h (working copy)
539 @@ -186,7 +186,6 @@ struct flock64
542 #ifdef __USE_GNU
543 -#if 0
544 /* Flags for SYNC_FILE_RANGE. */
545 # define SYNC_FILE_RANGE_WAIT_BEFORE 1 /* Wait upon writeout of all pages
546 in the range before performing the
547 @@ -197,7 +196,6 @@ struct flock64
548 # define SYNC_FILE_RANGE_WAIT_AFTER 4 /* Wait upon writeout of all pages in
549 the range after performing the
550 write. */
551 -#endif
553 /* Flags for SPLICE and VMSPLICE. */
554 # define SPLICE_F_MOVE 1 /* Move pages instead of copying. */
555 @@ -217,11 +215,9 @@ extern ssize_t readahead (int __fd, __of
556 __THROW;
559 -#if 0
560 /* Selective file content synch'ing. */
561 extern int sync_file_range (int __fd, __off64_t __from, __off64_t __to,
562 unsigned int __flags);
563 -#endif
565 /* Splice address range into a pipe. */
566 extern ssize_t vmsplice (int __fdout, const struct iovec *__iov,
567 Index: uClibc/libc/sysdeps/linux/powerpc/bits/fcntl.h
568 ===================================================================
569 --- uClibc/libc/sysdeps/linux/powerpc/bits/fcntl.h (revision 23383)
570 +++ uClibc/libc/sysdeps/linux/powerpc/bits/fcntl.h (working copy)
571 @@ -190,7 +190,6 @@ struct flock64
574 #ifdef __USE_GNU
575 -#if 0
576 /* Flags for SYNC_FILE_RANGE. */
577 # define SYNC_FILE_RANGE_WAIT_BEFORE 1 /* Wait upon writeout of all pages
578 in the range before performing the
579 @@ -201,7 +200,6 @@ struct flock64
580 # define SYNC_FILE_RANGE_WAIT_AFTER 4 /* Wait upon writeout of all pages in
581 the range after performing the
582 write. */
583 -#endif
585 /* Flags for SPLICE and VMSPLICE. */
586 # define SPLICE_F_MOVE 1 /* Move pages instead of copying. */
587 @@ -221,11 +219,9 @@ extern ssize_t readahead (int __fd, __of
588 __THROW;
591 -#if 0
592 /* Selective file content synch'ing. */
593 extern int sync_file_range (int __fd, __off64_t __from, __off64_t __to,
594 unsigned int __flags);
595 -#endif
597 /* Splice address range into a pipe. */
598 extern ssize_t vmsplice (int __fdout, const struct iovec *__iov,
599 Index: uClibc/libc/sysdeps/linux/sh64/bits/fcntl.h
600 ===================================================================
601 --- uClibc/libc/sysdeps/linux/sh64/bits/fcntl.h (revision 23383)
602 +++ uClibc/libc/sysdeps/linux/sh64/bits/fcntl.h (working copy)
603 @@ -165,7 +165,6 @@ struct flock64
606 #ifdef __USE_GNU
607 -#if 0
608 /* Flags for SYNC_FILE_RANGE. */
609 # define SYNC_FILE_RANGE_WAIT_BEFORE 1 /* Wait upon writeout of all pages
610 in the range before performing the
611 @@ -176,7 +175,6 @@ struct flock64
612 # define SYNC_FILE_RANGE_WAIT_AFTER 4 /* Wait upon writeout of all pages in
613 the range after performing the
614 write. */
615 -#endif
617 /* Flags for SPLICE and VMSPLICE. */
618 # define SPLICE_F_MOVE 1 /* Move pages instead of copying. */
619 @@ -196,11 +194,9 @@ extern ssize_t readahead (int __fd, __of
620 __THROW;
623 -#if 0
624 /* Selective file content synch'ing. */
625 extern int sync_file_range (int __fd, __off64_t __from, __off64_t __to,
626 unsigned int __flags);
627 -#endif
629 /* Splice address range into a pipe. */
630 extern ssize_t vmsplice (int __fdout, const struct iovec *__iov,
631 Index: uClibc/libc/sysdeps/linux/sh/bits/fcntl.h
632 ===================================================================
633 --- uClibc/libc/sysdeps/linux/sh/bits/fcntl.h (revision 23383)
634 +++ uClibc/libc/sysdeps/linux/sh/bits/fcntl.h (working copy)
635 @@ -190,7 +190,6 @@ struct flock64
638 #ifdef __USE_GNU
639 -#if 0
640 /* Flags for SYNC_FILE_RANGE. */
641 # define SYNC_FILE_RANGE_WAIT_BEFORE 1 /* Wait upon writeout of all pages
642 in the range before performing the
643 @@ -201,7 +200,6 @@ struct flock64
644 # define SYNC_FILE_RANGE_WAIT_AFTER 4 /* Wait upon writeout of all pages in
645 the range after performing the
646 write. */
647 -#endif
649 /* Flags for SPLICE and VMSPLICE. */
650 # define SPLICE_F_MOVE 1 /* Move pages instead of copying. */
651 @@ -221,11 +219,9 @@ extern ssize_t readahead (int __fd, __of
652 __THROW;
655 -#if 0
656 /* Selective file content synch'ing. */
657 extern int sync_file_range (int __fd, __off64_t __from, __off64_t __to,
658 unsigned int __flags);
659 -#endif
661 /* Splice address range into a pipe. */
662 extern ssize_t vmsplice (int __fdout, const struct iovec *__iov,
663 Index: uClibc/libc/sysdeps/linux/sparc/bits/fcntl.h
664 ===================================================================
665 --- uClibc/libc/sysdeps/linux/sparc/bits/fcntl.h (revision 23383)
666 +++ uClibc/libc/sysdeps/linux/sparc/bits/fcntl.h (working copy)
667 @@ -209,7 +209,6 @@ struct flock64
670 #ifdef __USE_GNU
671 -#if 0
672 /* Flags for SYNC_FILE_RANGE. */
673 # define SYNC_FILE_RANGE_WAIT_BEFORE 1 /* Wait upon writeout of all pages
674 in the range before performing the
675 @@ -220,7 +219,6 @@ struct flock64
676 # define SYNC_FILE_RANGE_WAIT_AFTER 4 /* Wait upon writeout of all pages in
677 the range after performing the
678 write. */
679 -#endif
681 /* Flags for SPLICE and VMSPLICE. */
682 # define SPLICE_F_MOVE 1 /* Move pages instead of copying. */
683 @@ -240,11 +238,9 @@ extern ssize_t readahead (int __fd, __of
684 __THROW;
687 -#if 0
688 /* Selective file content synch'ing. */
689 extern int sync_file_range (int __fd, __off64_t __from, __off64_t __to,
690 unsigned int __flags);
691 -#endif
693 /* Splice address range into a pipe. */
694 extern ssize_t vmsplice (int __fdout, const struct iovec *__iov,
695 Index: uClibc/libc/sysdeps/linux/v850/bits/fcntl.h
696 ===================================================================
697 --- uClibc/libc/sysdeps/linux/v850/bits/fcntl.h (revision 23383)
698 +++ uClibc/libc/sysdeps/linux/v850/bits/fcntl.h (working copy)
699 @@ -183,7 +183,6 @@ struct flock64
702 #ifdef __USE_GNU
703 -#if 0
704 /* Flags for SYNC_FILE_RANGE. */
705 # define SYNC_FILE_RANGE_WAIT_BEFORE 1 /* Wait upon writeout of all pages
706 in the range before performing the
707 @@ -194,7 +193,6 @@ struct flock64
708 # define SYNC_FILE_RANGE_WAIT_AFTER 4 /* Wait upon writeout of all pages in
709 the range after performing the
710 write. */
711 -#endif
713 /* Flags for SPLICE and VMSPLICE. */
714 # define SPLICE_F_MOVE 1 /* Move pages instead of copying. */
715 @@ -214,11 +212,9 @@ extern ssize_t readahead (int __fd, __of
716 __THROW;
719 -#if 0
720 /* Selective file content synch'ing. */
721 extern int sync_file_range (int __fd, __off64_t __from, __off64_t __to,
722 unsigned int __flags);
723 -#endif
725 /* Splice address range into a pipe. */
726 extern ssize_t vmsplice (int __fdout, const struct iovec *__iov,
727 Index: uClibc/libc/sysdeps/linux/vax/bits/fcntl.h
728 ===================================================================
729 --- uClibc/libc/sysdeps/linux/vax/bits/fcntl.h (revision 23383)
730 +++ uClibc/libc/sysdeps/linux/vax/bits/fcntl.h (working copy)
731 @@ -163,7 +163,6 @@ struct flock64
734 #ifdef __USE_GNU
735 -#if 0
736 /* Flags for SYNC_FILE_RANGE. */
737 # define SYNC_FILE_RANGE_WAIT_BEFORE 1 /* Wait upon writeout of all pages
738 in the range before performing the
739 @@ -174,7 +173,6 @@ struct flock64
740 # define SYNC_FILE_RANGE_WAIT_AFTER 4 /* Wait upon writeout of all pages in
741 the range after performing the
742 write. */
743 -#endif
745 /* Flags for SPLICE and VMSPLICE. */
746 # define SPLICE_F_MOVE 1 /* Move pages instead of copying. */
747 @@ -194,11 +192,9 @@ extern ssize_t readahead (int __fd, __of
748 __THROW;
751 -#if 0
752 /* Selective file content synch'ing. */
753 extern int sync_file_range (int __fd, __off64_t __from, __off64_t __to,
754 unsigned int __flags);
755 -#endif
757 /* Splice address range into a pipe. */
758 extern ssize_t vmsplice (int __fdout, const struct iovec *__iov,
759 Index: uClibc/libc/sysdeps/linux/x86_64/bits/fcntl.h
760 ===================================================================
761 --- uClibc/libc/sysdeps/linux/x86_64/bits/fcntl.h (revision 23383)
762 +++ uClibc/libc/sysdeps/linux/x86_64/bits/fcntl.h (working copy)
763 @@ -204,7 +204,6 @@ struct flock64
766 #ifdef __USE_GNU
767 -#if 0
768 /* Flags for SYNC_FILE_RANGE. */
769 # define SYNC_FILE_RANGE_WAIT_BEFORE 1 /* Wait upon writeout of all pages
770 in the range before performing the
771 @@ -215,7 +214,6 @@ struct flock64
772 # define SYNC_FILE_RANGE_WAIT_AFTER 4 /* Wait upon writeout of all pages in
773 the range after performing the
774 write. */
775 -#endif
777 /* Flags for SPLICE and VMSPLICE. */
778 # define SPLICE_F_MOVE 1 /* Move pages instead of copying. */
779 @@ -235,11 +233,9 @@ extern ssize_t readahead (int __fd, __of
780 __THROW;
783 -#if 0
784 /* Selective file content synch'ing. */
785 extern int sync_file_range (int __fd, __off64_t __from, __off64_t __to,
786 unsigned int __flags);
787 -#endif
789 /* Splice address range into a pipe. */
790 extern ssize_t vmsplice (int __fdout, const struct iovec *__iov,
791 Index: uClibc/libc/sysdeps/linux/xtensa/bits/fcntl.h
792 ===================================================================
793 --- uClibc/libc/sysdeps/linux/xtensa/bits/fcntl.h (revision 23383)
794 +++ uClibc/libc/sysdeps/linux/xtensa/bits/fcntl.h (working copy)
795 @@ -187,7 +187,6 @@ struct flock64
798 #ifdef __USE_GNU
799 -#if 0
800 /* Flags for SYNC_FILE_RANGE. */
801 # define SYNC_FILE_RANGE_WAIT_BEFORE 1 /* Wait upon writeout of all pages
802 in the range before performing the
803 @@ -198,7 +197,6 @@ struct flock64
804 # define SYNC_FILE_RANGE_WAIT_AFTER 4 /* Wait upon writeout of all pages in
805 the range after performing the
806 write. */
807 -#endif
809 /* Flags for SPLICE and VMSPLICE. */
810 # define SPLICE_F_MOVE 1 /* Move pages instead of copying. */
811 @@ -218,11 +216,9 @@ extern ssize_t readahead (int __fd, __of
812 __THROW;
815 -#if 0
816 /* Selective file content synch'ing. */
817 extern int sync_file_range (int __fd, __off64_t __from, __off64_t __to,
818 unsigned int __flags);
819 -#endif
821 /* Splice address range into a pipe. */
822 extern ssize_t vmsplice (int __fdout, const struct iovec *__iov,
823 Index: uClibc/libc/sysdeps/linux/i386/sync_file_range.S
824 ===================================================================
825 --- uClibc/libc/sysdeps/linux/i386/sync_file_range.S (revision 0)
826 +++ uClibc/libc/sysdeps/linux/i386/sync_file_range.S (revision 0)
827 @@ -0,0 +1,67 @@
828 +/* Copyright (C) 2006, 2007 Free Software Foundation, Inc.
829 + This file is part of the GNU C Library.
831 + The GNU C Library is free software; you can redistribute it and/or
832 + modify it under the terms of the GNU Lesser General Public
833 + License as published by the Free Software Foundation; either
834 + version 2.1 of the License, or (at your option) any later version.
836 + The GNU C Library is distributed in the hope that it will be useful,
837 + but WITHOUT ANY WARRANTY; without even the implied warranty of
838 + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
839 + Lesser General Public License for more details.
841 + You should have received a copy of the GNU Lesser General Public
842 + License along with the GNU C Library; if not, write to the Free
843 + Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
844 + 02111-1307 USA. */
846 +#define _ERRNO_H 1
847 +#include <features.h>
848 +#include <bits/errno.h>
849 +#include <sys/syscall.h>
851 +.text
852 +.global sync_file_range
853 +.type sync_file_range,%function
854 +sync_file_range:
855 +#ifdef __NR_sync_file_range
857 + /* Save regs */
858 + pushl %ebx
859 + pushl %esi
860 + pushl %edi
861 + pushl %ebp
863 + movl $__NR_sync_file_range, %eax /* Syscall number in %eax. */
865 + movl 20(%esp), %ebx
866 + movl 24(%esp), %ecx
867 + movl 28(%esp), %edx
868 + movl 32(%esp), %esi
869 + movl 36(%esp), %edi
870 + movl 40(%esp), %ebp
872 + /* Do the system call trap. */
873 + int $0x80
875 + /* Restore regs */
876 + popl %ebp
877 + popl %edi
878 + popl %esi
879 + popl %ebx
881 + /* If 0 > %eax > -4096 there was an error. */
882 + cmpl $-4096, %eax
883 + ja __syscall_error
884 +#else
885 + movl $-ENOSYS, %eax
886 + jmp __syscall_error
887 +#endif
888 + /* Successful; return the syscall's value. */
889 + ret
891 +.size sync_file_range,.-sync_file_range
893 +libc_hidden_def(sync_file_range)