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))
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)
21 +/* vi: set sw=4 ts=4: */
23 + * sync_file_range() for uClibc
25 + * Copyright (C) 2008 Bernhard Reutner-Fischer <uclibc@uclibc.org>
27 + * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
29 +#include <features.h>
30 +#include <sys/syscall.h>
31 +#if defined __USE_GNU
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)),
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);
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
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
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
80 /* Selective file content synch'ing. */
81 extern int sync_file_range (int __fd, __off64_t __from, __off64_t __to,
82 unsigned int __flags);
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
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
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)
112 /* Selective file content synch'ing. */
113 extern int sync_file_range (int __fd, __off64_t __from, __off64_t __to,
114 unsigned int __flags);
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
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
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
144 /* Selective file content synch'ing. */
145 extern int sync_file_range (int __fd, __off64_t __from, __off64_t __to,
146 unsigned int __flags);
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
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
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
176 /* Selective file content synch'ing. */
177 extern int sync_file_range (int __fd, __off64_t __from, __off64_t __to,
178 unsigned int __flags);
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
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
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
208 /* Selective file content synch'ing. */
209 extern int sync_file_range (int __fd, __off64_t __from, __off64_t __to,
210 unsigned int __flags);
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
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
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
240 /* Selective file content synch'ing. */
241 extern int sync_file_range (int __fd, __off64_t __from, __off64_t __to,
242 unsigned int __flags);
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
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
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
272 /* Selective file content synch'ing. */
273 extern int sync_file_range (int __fd, __off64_t __from, __off64_t __to,
274 unsigned int __flags);
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
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
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
304 /* Selective file content synch'ing. */
305 extern int sync_file_range (int __fd, __off64_t __from, __off64_t __to,
306 unsigned int __flags);
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
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
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
336 /* Selective file content synch'ing. */
337 extern int sync_file_range (int __fd, __off64_t __from, __off64_t __to,
338 unsigned int __flags);
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
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
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
368 /* Selective file content synch'ing. */
369 extern int sync_file_range (int __fd, __off64_t __from, __off64_t __to,
370 unsigned int __flags);
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
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
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
400 /* Selective file content synch'ing. */
401 extern int sync_file_range (int __fd, __off64_t __from, __off64_t __to,
402 unsigned int __flags);
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
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
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
432 /* Selective file content synch'ing. */
433 extern int sync_file_range (int __fd, __off64_t __from, __off64_t __to,
434 unsigned int __flags);
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
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
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
464 /* Selective file content synch'ing. */
465 extern int sync_file_range (int __fd, __off64_t __from, __off64_t __to,
466 unsigned int __flags);
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
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
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
496 /* Selective file content synch'ing. */
497 extern int sync_file_range (int __fd, __off64_t __from, __off64_t __to,
498 unsigned int __flags);
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
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
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
528 /* Selective file content synch'ing. */
529 extern int sync_file_range (int __fd, __off64_t __from, __off64_t __to,
530 unsigned int __flags);
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
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
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
560 /* Selective file content synch'ing. */
561 extern int sync_file_range (int __fd, __off64_t __from, __off64_t __to,
562 unsigned int __flags);
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
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
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
592 /* Selective file content synch'ing. */
593 extern int sync_file_range (int __fd, __off64_t __from, __off64_t __to,
594 unsigned int __flags);
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
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
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
624 /* Selective file content synch'ing. */
625 extern int sync_file_range (int __fd, __off64_t __from, __off64_t __to,
626 unsigned int __flags);
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
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
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
656 /* Selective file content synch'ing. */
657 extern int sync_file_range (int __fd, __off64_t __from, __off64_t __to,
658 unsigned int __flags);
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
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
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
688 /* Selective file content synch'ing. */
689 extern int sync_file_range (int __fd, __off64_t __from, __off64_t __to,
690 unsigned int __flags);
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
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
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
720 /* Selective file content synch'ing. */
721 extern int sync_file_range (int __fd, __off64_t __from, __off64_t __to,
722 unsigned int __flags);
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
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
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
752 /* Selective file content synch'ing. */
753 extern int sync_file_range (int __fd, __off64_t __from, __off64_t __to,
754 unsigned int __flags);
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
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
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
784 /* Selective file content synch'ing. */
785 extern int sync_file_range (int __fd, __off64_t __from, __off64_t __to,
786 unsigned int __flags);
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
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
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
816 /* Selective file content synch'ing. */
817 extern int sync_file_range (int __fd, __off64_t __from, __off64_t __to,
818 unsigned int __flags);
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)
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
847 +#include <features.h>
848 +#include <bits/errno.h>
849 +#include <sys/syscall.h>
852 +.global sync_file_range
853 +.type sync_file_range,%function
855 +#ifdef __NR_sync_file_range
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. */
881 + /* If 0 > %eax > -4096 there was an error. */
885 + movl $-ENOSYS, %eax
886 + jmp __syscall_error
888 + /* Successful; return the syscall's value. */
891 +.size sync_file_range,.-sync_file_range
893 +libc_hidden_def(sync_file_range)