diff options
| author | Andrew Kelley <andrew@ziglang.org> | 2019-07-15 20:46:12 -0400 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2019-07-15 20:46:12 -0400 |
| commit | 3f4abe97bdbe666dbb3532c14a97e414aae4caca (patch) | |
| tree | ba08f2f14e79a8c8f7e83cea0344826fefffd9a2 /lib/libc/musl/src/linux/sync_file_range.c | |
| parent | 33eaaadd01b20d1327b67758664ce1265216e471 (diff) | |
| parent | aff90c22520bbbadd56fbfd1378f161ee8a3cdb2 (diff) | |
| download | zig-3f4abe97bdbe666dbb3532c14a97e414aae4caca.tar.gz zig-3f4abe97bdbe666dbb3532c14a97e414aae4caca.zip | |
Merge pull request #2892 from ziglang/install-with-zig-build
move some of the installation from cmake to zig build
Diffstat (limited to 'lib/libc/musl/src/linux/sync_file_range.c')
| -rw-r--r-- | lib/libc/musl/src/linux/sync_file_range.c | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/lib/libc/musl/src/linux/sync_file_range.c b/lib/libc/musl/src/linux/sync_file_range.c new file mode 100644 index 0000000000..6859abc05d --- /dev/null +++ b/lib/libc/musl/src/linux/sync_file_range.c @@ -0,0 +1,17 @@ +#define _GNU_SOURCE +#include <fcntl.h> +#include <errno.h> +#include "syscall.h" + +int sync_file_range(int fd, off_t pos, off_t len, unsigned flags) +{ +#if defined(SYS_sync_file_range2) + return syscall(SYS_sync_file_range2, fd, flags, + __SYSCALL_LL_E(pos), __SYSCALL_LL_E(len)); +#elif defined(SYS_sync_file_range) + return syscall(SYS_sync_file_range, fd, + __SYSCALL_LL_O(pos), __SYSCALL_LL_E(len), flags); +#else + return __syscall_ret(-ENOSYS); +#endif +} |
