Skip to content

Commit cd22381

Browse files
committed
Use syscall! for copy_file_range too
1 parent a035626 commit cd22381

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

library/std/src/sys/unix/kernel_copy.rs

+9-9
Original file line numberDiff line numberDiff line change
@@ -445,15 +445,15 @@ pub(super) fn copy_regular_files(reader: RawFd, writer: RawFd, max_len: u64) ->
445445
// We store the availability in a global to avoid unnecessary syscalls
446446
static HAS_COPY_FILE_RANGE: AtomicBool = AtomicBool::new(true);
447447

448-
unsafe fn copy_file_range(
449-
fd_in: libc::c_int,
450-
off_in: *mut libc::loff_t,
451-
fd_out: libc::c_int,
452-
off_out: *mut libc::loff_t,
453-
len: libc::size_t,
454-
flags: libc::c_uint,
455-
) -> libc::c_long {
456-
libc::syscall(libc::SYS_copy_file_range, fd_in, off_in, fd_out, off_out, len, flags)
448+
syscall! {
449+
fn copy_file_range(
450+
fd_in: libc::c_int,
451+
off_in: *mut libc::loff_t,
452+
fd_out: libc::c_int,
453+
off_out: *mut libc::loff_t,
454+
len: libc::size_t,
455+
flags: libc::c_uint
456+
) -> libc::ssize_t
457457
}
458458

459459
let has_copy_file_range = HAS_COPY_FILE_RANGE.load(Ordering::Relaxed);

0 commit comments

Comments
 (0)