MCPcopy Create free account
hub / github.com/bytecodealliance/rustix / pwritev

Function pwritev

src/backend/libc/io/syscalls.rs:136–151  ·  view source on GitHub ↗
(fd: BorrowedFd<'_>, bufs: &[IoSlice<'_>], offset: u64)

Source from the content-addressed store, hash-verified

134 target_os = "vita",
135)))]
136pub(crate) fn pwritev(fd: BorrowedFd<'_>, bufs: &[IoSlice<'_>], offset: u64) -> io::Result<usize> {
137 // Silently cast; we'll get `EINVAL` if the value is negative.
138 let offset = offset as i64;
139
140 // ESP-IDF and Vita don't support 64-bit offsets, for example.
141 let offset = offset.try_into().map_err(|_| io::Errno::OVERFLOW)?;
142
143 unsafe {
144 ret_usize(c::pwritev(
145 borrowed_fd(fd),
146 bufs.as_ptr().cast::<c::iovec>(),
147 min(bufs.len(), MAX_IOV) as c::c_int,
148 offset,
149 ))
150 }
151}
152
153#[cfg(all(linux_kernel, not(target_os = "android")))]
154pub(crate) fn preadv2(

Callers 1

pwritev64Function · 0.50

Calls 4

borrowed_fdFunction · 0.85
ret_usizeFunction · 0.50
as_ptrMethod · 0.45
lenMethod · 0.45

Tested by

no test coverage detected