| ... | @@ -2811,6 +2811,7 @@ pub const libc = struct { | ... | @@ -2811,6 +2811,7 @@ pub const libc = struct { |
| 2811 | pub extern fn sched_getaffinity(pid: pid_t, cpusetsize: usize, mask: *cpu_set_t) c_int; | 2811 | pub extern fn sched_getaffinity(pid: pid_t, cpusetsize: usize, mask: *cpu_set_t) c_int; |
| 2812 | pub extern fn getrandom(buf: [*]u8, size: usize, flags: c_uint) isize; | 2812 | pub extern fn getrandom(buf: [*]u8, size: usize, flags: c_uint) isize; |
| 2813 | pub extern fn flock(fd: c_int, op: c_int) c_int; | 2813 | pub extern fn flock(fd: c_int, op: c_int) c_int; |
| | 2814 | pub extern fn copy_file_range(fd_int: c_int, off_in: ?*off_t, fd_out: c_int, off_out: ?*off_t, size: usize, flags: c_uint) isize; |
| 2814 | }; | 2815 | }; |
| 2815 | | 2816 | |
| 2816 | comptime { | 2817 | comptime { |
| ... | @@ -3727,3 +3728,9 @@ pub fn fchmod(fd: c_int, mode: mode_t) !void { | ... | @@ -3727,3 +3728,9 @@ pub fn fchmod(fd: c_int, mode: mode_t) !void { |
| 3727 | if (rc == -1) return errno.fromInt(errno.fromLibC()); | 3728 | if (rc == -1) return errno.fromInt(errno.fromLibC()); |
| 3728 | std.debug.assert(rc == 0); | 3729 | std.debug.assert(rc == 0); |
| 3729 | } | 3730 | } |
| | 3731 | pub fn copy_file_range(fd_int: c_int, off_in: ?*off_t, fd_out: c_int, off_out: ?*off_t, size: usize, flags: c_uint) errno.Error!usize { |
| | 3732 | const rc = libc.copy_file_range(fd_int, off_in, fd_out, off_out, size, flags); |
| | 3733 | if (rc == -1) return errno.fromInt(errno.fromLibC()); |
| | 3734 | std.debug.assert(rc >= 0); |
| | 3735 | return @intCast(rc); |
| | 3736 | } |