fix errno for posix_openpt with no free ptys available
[musl.git] / src / linux / sync_file_range.c
blob6859abc05dabde2825af4a392b2b0e0d255f2a4e
1 #define _GNU_SOURCE
2 #include <fcntl.h>
3 #include <errno.h>
4 #include "syscall.h"
6 int sync_file_range(int fd, off_t pos, off_t len, unsigned flags)
8 #if defined(SYS_sync_file_range2)
9 return syscall(SYS_sync_file_range2, fd, flags,
10 __SYSCALL_LL_E(pos), __SYSCALL_LL_E(len));
11 #elif defined(SYS_sync_file_range)
12 return syscall(SYS_sync_file_range, fd,
13 __SYSCALL_LL_O(pos), __SYSCALL_LL_E(len), flags);
14 #else
15 return __syscall_ret(-ENOSYS);
16 #endif