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

Function pwritev

src/backend/linux_raw/io/syscalls.rs:231–246  ·  view source on GitHub ↗
(fd: BorrowedFd<'_>, bufs: &[IoSlice<'_>], pos: u64)

Source from the content-addressed store, hash-verified

229
230#[inline]
231pub(crate) fn pwritev(fd: BorrowedFd<'_>, bufs: &[IoSlice<'_>], pos: u64) -> io::Result<usize> {
232 let (bufs_addr, bufs_len) = slice(&bufs[..cmp::min(bufs.len(), MAX_IOV)]);
233
234 // Unlike the plain "p" functions, the "pv" functions pass their offset in
235 // an endian-independent way, and always in two registers.
236 unsafe {
237 ret_usize(syscall_readonly!(
238 __NR_pwritev,
239 fd,
240 bufs_addr,
241 bufs_len,
242 pass_usize(pos as usize),
243 pass_usize((pos >> 32) as usize)
244 ))
245 }
246}
247
248#[inline]
249pub(crate) fn pwritev2(

Callers

nothing calls this directly

Calls 3

sliceFunction · 0.85
ret_usizeFunction · 0.50
lenMethod · 0.45

Tested by

no test coverage detected