diff --git a/libc-test/build.rs b/libc-test/build.rs index ccbef16c5cd13..3cd512a51c89f 100755 --- a/libc-test/build.rs +++ b/libc-test/build.rs @@ -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, } }); diff --git a/src/unix/bsd/apple/mod.rs b/src/unix/bsd/apple/mod.rs index 581603920bc56..c167ceb128461 100644 --- a/src/unix/bsd/apple/mod.rs +++ b/src/unix/bsd/apple/mod.rs @@ -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,