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

Function preadv2

src/backend/linux_raw/io/syscalls.rs:137–158  ·  view source on GitHub ↗
(
    fd: BorrowedFd<'_>,
    bufs: &mut [IoSliceMut<'_>],
    pos: u64,
    flags: ReadWriteFlags,
)

Source from the content-addressed store, hash-verified

135
136#[inline]
137pub(crate) fn preadv2(
138 fd: BorrowedFd<'_>,
139 bufs: &mut [IoSliceMut<'_>],
140 pos: u64,
141 flags: ReadWriteFlags,
142) -> io::Result<usize> {
143 let (bufs_addr, bufs_len) = slice(&bufs[..cmp::min(bufs.len(), MAX_IOV)]);
144
145 // Unlike the plain "p" functions, the "pv" functions pass their offset in
146 // an endian-independent way, and always in two registers.
147 unsafe {
148 ret_usize(syscall!(
149 __NR_preadv2,
150 fd,
151 bufs_addr,
152 bufs_len,
153 pass_usize(pos as usize),
154 pass_usize((pos >> 32) as usize),
155 flags
156 ))
157 }
158}
159
160#[inline]
161pub(crate) fn write(fd: BorrowedFd<'_>, buf: &[u8]) -> io::Result<usize> {

Callers

nothing calls this directly

Calls 3

sliceFunction · 0.85
ret_usizeFunction · 0.50
lenMethod · 0.45

Tested by

no test coverage detected