Function
pwritev2
(
fd: BorrowedFd<'_>,
bufs: &[IoSlice<'_>],
pos: u64,
flags: ReadWriteFlags,
)
Source from the content-addressed store, hash-verified
| 247 | |
| 248 | #[inline] |
| 249 | pub(crate) fn pwritev2( |
| 250 | fd: BorrowedFd<'_>, |
| 251 | bufs: &[IoSlice<'_>], |
| 252 | pos: u64, |
| 253 | flags: ReadWriteFlags, |
| 254 | ) -> io::Result<usize> { |
| 255 | let (bufs_addr, bufs_len) = slice(&bufs[..cmp::min(bufs.len(), MAX_IOV)]); |
| 256 | |
| 257 | // Unlike the plain "p" functions, the "pv" functions pass their offset in |
| 258 | // an endian-independent way, and always in two registers. |
| 259 | unsafe { |
| 260 | ret_usize(syscall_readonly!( |
| 261 | __NR_pwritev2, |
| 262 | fd, |
| 263 | bufs_addr, |
| 264 | bufs_len, |
| 265 | pass_usize(pos as usize), |
| 266 | pass_usize((pos >> 32) as usize), |
| 267 | flags |
| 268 | )) |
| 269 | } |
| 270 | } |
| 271 | |
| 272 | #[inline] |
| 273 | pub(crate) unsafe fn close(fd: RawFd) { |
Callers
nothing calls this directly
Tested by
no test coverage detected