diff options
| author | Maciej Walczak <14938807+xackus@users.noreply.github.com> | 2020-08-11 21:49:43 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-08-11 15:49:43 -0400 |
| commit | 6febe7e977072fea1bf7b6003be2d6c1f3654905 (patch) | |
| tree | 77c7d9bae1ec5ea2e7254eefba240f50f6904390 /lib/std/os | |
| parent | 2b28cebf644b29543fcb52504b11931a7c797ffb (diff) | |
| download | zig-6febe7e977072fea1bf7b6003be2d6c1f3654905.tar.gz zig-6febe7e977072fea1bf7b6003be2d6c1f3654905.zip | |
copy_file_range linux syscall (#6010)
Diffstat (limited to 'lib/std/os')
| -rw-r--r-- | lib/std/os/linux.zig | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/lib/std/os/linux.zig b/lib/std/os/linux.zig index 15d6e53c1e..d9f7dda03e 100644 --- a/lib/std/os/linux.zig +++ b/lib/std/os/linux.zig @@ -1210,6 +1210,18 @@ pub fn signalfd4(fd: fd_t, mask: *const sigset_t, flags: i32) usize { ); } +pub fn copy_file_range(fd_in: fd_t, off_in: ?*i64, fd_out: fd_t, off_out: ?*i64, len: usize, flags: u32) usize { + return syscall6( + .copy_file_range, + @bitCast(usize, @as(isize, fd_in)), + @ptrToInt(off_in), + @bitCast(usize, @as(isize, fd_out)), + @ptrToInt(off_out), + len, + flags, + ); +} + test "" { if (builtin.os.tag == .linux) { _ = @import("linux/test.zig"); |
