Skip to content

Commit

Permalink
Updated the docs for preadv and pwritev
Browse files Browse the repository at this point in the history
  • Loading branch information
simlay committed Apr 21, 2024
1 parent 6550bd0 commit b411fb7
Showing 1 changed file with 10 additions and 6 deletions.
16 changes: 10 additions & 6 deletions library/std/src/sys/pal/unix/fd.rs
Original file line number Diff line number Diff line change
Expand Up @@ -250,13 +250,15 @@ impl FileDesc {
}
}

// We support old MacOS, iOS, watchOS, tvOS and visionOS versions that do not have `preadv`.
// There is no `syscall` possible in these platform for following apple versions:
// We support old MacOS, iOS, watchOS, tvOS and visionOS. `preadv` was added in the following
// Apple OS versions:
// ios 14.0
// tvos 14.0
// macos 11.0
// watchos 7.0
// visionos 1.0
//
// These versions may be newer than the minimum supported versions of OS's we support so we must
// use "weak" linking.
#[cfg(target_vendor = "apple")]
pub fn read_vectored_at(&self, bufs: &mut [IoSliceMut<'_>], offset: u64) -> io::Result<usize> {
super::weak::weak!(fn preadv(libc::c_int, *const libc::iovec, libc::c_int, off64_t) -> isize);
Expand Down Expand Up @@ -425,13 +427,15 @@ impl FileDesc {
}
}

// We support old MacOS, iOS, watchOS, tvOS and visionOS versions that do not have `pwritev`.
// There is no `syscall` possible in these platform for following apple versions:
// We support old MacOS, iOS, watchOS, tvOS and visionOS. `pwritev` was added in the following
// Apple OS versions:
// ios 14.0
// tvos 14.0
// macos 11.0
// watchos 7.0
// visionos 1.0
//
// These versions may be newer than the minimum supported versions of OS's we support so we must
// use "weak" linking.
#[cfg(target_vendor = "apple")]
pub fn write_vectored_at(&self, bufs: &[IoSlice<'_>], offset: u64) -> io::Result<usize> {
super::weak::weak!(fn pwritev(libc::c_int, *const libc::iovec, libc::c_int, off64_t) -> isize);
Expand Down

0 comments on commit b411fb7

Please sign in to comment.