Skip to content

Commit

Permalink
Auto merge of #3133 - slp:musl-copy-file-range, r=JohnTitor
Browse files Browse the repository at this point in the history
linux/musl: add copy_file_range syscall wrapper

musl supports copy_file_range since v1.1.24, so expose the corresponding wrapper here too.
  • Loading branch information
bors committed Mar 3, 2023
2 parents 6275bac + 19084be commit 837c461
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 8 deletions.
1 change: 1 addition & 0 deletions libc-test/semver/linux-musl.txt
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ aio_suspend
aio_write
aiocb
clock_adjtime
copy_file_range
ctermid
explicit_bzero
futimes
Expand Down
8 changes: 0 additions & 8 deletions src/unix/linux_like/linux/gnu/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1212,14 +1212,6 @@ extern "C" {
pub fn ntp_gettime(buf: *mut ntptimeval) -> ::c_int;
pub fn clock_adjtime(clk_id: ::clockid_t, buf: *mut ::timex) -> ::c_int;

pub fn copy_file_range(
fd_in: ::c_int,
off_in: *mut ::off64_t,
fd_out: ::c_int,
off_out: *mut ::off64_t,
len: ::size_t,
flags: ::c_uint,
) -> ::ssize_t;
pub fn fanotify_mark(
fd: ::c_int,
flags: ::c_uint,
Expand Down
9 changes: 9 additions & 0 deletions src/unix/linux_like/linux/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4702,6 +4702,15 @@ extern "C" {
longopts: *const option,
longindex: *mut ::c_int,
) -> ::c_int;

pub fn copy_file_range(
fd_in: ::c_int,
off_in: *mut ::off64_t,
fd_out: ::c_int,
off_out: *mut ::off64_t,
len: ::size_t,
flags: ::c_uint,
) -> ::ssize_t;
}

cfg_if! {
Expand Down

0 comments on commit 837c461

Please sign in to comment.