1 /* vi: set sw=4 ts=4: */
3 * sync_file_range() for uClibc
5 * Copyright (C) 2008 Bernhard Reutner-Fischer <uclibc@uclibc.org>
7 * Licensed under the LGPL v2.1 or later, see the file COPYING.LIB in this tarball.
10 #include <sys/syscall.h>
11 #if defined __UCLIBC_HAS_LFS__ && defined __USE_GNU
12 # include <bits/wordsize.h>
17 # ifdef __NR_sync_file_range2
18 # undef __NR_sync_file_range
19 # define __NR_sync_file_range __NR_sync_file_range2
22 # ifdef __NR_sync_file_range
23 static int __NC(sync_file_range)(int fd, off64_t offset, off64_t nbytes, unsigned int flags)
25 # if defined __powerpc__ && __WORDSIZE == 64
26 return INLINE_SYSCALL(sync_file_range, 4, fd, offset, nbytes, flags);
27 # elif defined __mips__ && _MIPS_SIM == _ABIO32
28 return INLINE_SYSCALL(sync_file_range, 7, fd, 0,
29 OFF64_HI_LO(offset), OFF64_HI_LO(nbytes), flags);
31 return INLINE_SYSCALL(sync_file_range, 6, fd,
32 OFF64_HI_LO(offset), OFF64_HI_LO(nbytes), flags);
35 CANCELLABLE_SYSCALL(int, sync_file_range, (int fd, off64_t offset, off64_t nbytes, unsigned int flags), (fd, offset, nbytes, flags))