1570af302Sopenharmony_ci#define _GNU_SOURCE 2570af302Sopenharmony_ci#include <fcntl.h> 3570af302Sopenharmony_ci#include <errno.h> 4570af302Sopenharmony_ci#include "syscall.h" 5570af302Sopenharmony_ci 6570af302Sopenharmony_ciint sync_file_range(int fd, off_t pos, off_t len, unsigned flags) 7570af302Sopenharmony_ci{ 8570af302Sopenharmony_ci#if defined(SYS_sync_file_range2) 9570af302Sopenharmony_ci return syscall(SYS_sync_file_range2, fd, flags, 10570af302Sopenharmony_ci __SYSCALL_LL_E(pos), __SYSCALL_LL_E(len)); 11570af302Sopenharmony_ci#elif defined(SYS_sync_file_range) 12570af302Sopenharmony_ci return syscall(SYS_sync_file_range, fd, 13570af302Sopenharmony_ci __SYSCALL_LL_O(pos), __SYSCALL_LL_E(len), flags); 14570af302Sopenharmony_ci#else 15570af302Sopenharmony_ci return __syscall_ret(-ENOSYS); 16570af302Sopenharmony_ci#endif 17570af302Sopenharmony_ci} 18