Merge pull request #2726 from sisungo/master

Change `os.rs` to build on musl libc
This commit is contained in:
Jeong YunWon
2021-07-10 04:23:35 +09:00
committed by GitHub

View File

@@ -1563,8 +1563,12 @@ mod _os {
// Safety: p_offset_src and p_offset_dst is a unique pointer for offset_src and offset_dst respectively,
// and will only be freed after this function ends.
//
// Why not use `libc::copy_file_range`: On `musl-libc`, `libc::copy_file_range` is not provided. Therefore
// we use syscalls directly instead.
let ret = unsafe {
libc::copy_file_range(
libc::syscall(
libc::SYS_copy_file_range,
args.src,
p_offset_src as *mut i64,
args.dst,