Skip to content

Commit

Permalink
Auto merge of #2040 - slp:add_preadv_pwritev, r=JohnTitor
Browse files Browse the repository at this point in the history
Add preadv and pwritev for macOS

Add declarations for the preadv and pwritev system calls, introduced
in macOS 11.0 (Big Sur).

Signed-off-by: Sergio Lopez <slp@redhat.com>
  • Loading branch information
bors committed Jan 26, 2021
2 parents 50adb91 + 81c3e98 commit 9b7dd7c
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 0 deletions.
3 changes: 3 additions & 0 deletions libc-test/build.rs
Expand Up @@ -213,6 +213,9 @@ fn test_apple(target: &str) {
// close calls the close_nocancel system call
"close" => true,

// these calls require macOS 11.0 or higher
"preadv" | "pwritev" => true,

_ => false,
}
});
Expand Down
12 changes: 12 additions & 0 deletions src/unix/bsd/apple/mod.rs
Expand Up @@ -3538,6 +3538,18 @@ extern "C" {
pub fn setpriority(which: ::c_int, who: ::id_t, prio: ::c_int) -> ::c_int;
pub fn getdomainname(name: *mut ::c_char, len: ::c_int) -> ::c_int;
pub fn setdomainname(name: *const ::c_char, len: ::c_int) -> ::c_int;
pub fn preadv(
fd: ::c_int,
iov: *const ::iovec,
iovcnt: ::c_int,
offset: ::off_t,
) -> ::ssize_t;
pub fn pwritev(
fd: ::c_int,
iov: *const ::iovec,
iovcnt: ::c_int,
offset: ::off_t,
) -> ::ssize_t;
pub fn getxattr(
path: *const ::c_char,
name: *const ::c_char,
Expand Down

0 comments on commit 9b7dd7c

Please sign in to comment.