(fd: BorrowedFd<'_>, bufs: &[IoSlice<'_>], offset: u64)
| 134 | target_os = "vita", |
| 135 | )))] |
| 136 | pub(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")))] |
| 154 | pub(crate) fn preadv2( |
no test coverage detected