| 262 | } |
| 263 | } |
| 264 | pub(in super::super) unsafe fn pwritev64( |
| 265 | fd: c_int, |
| 266 | iov: *const iovec, |
| 267 | iovcnt: c_int, |
| 268 | offset: off64_t, |
| 269 | ) -> ssize_t { |
| 270 | // See the comments in `preadv64`. |
| 271 | weak! { |
| 272 | fn pwritev64(c_int, *const iovec, c_int, off64_t) -> ssize_t |
| 273 | } |
| 274 | if let Some(fun) = pwritev64.get() { |
| 275 | fun(fd, iov, iovcnt, offset) |
| 276 | } else { |
| 277 | // Unlike the plain "p" functions, the "pv" functions pass their |
| 278 | // offset in an endian-independent way, and always in two |
| 279 | // registers. |
| 280 | syscall! { |
| 281 | fn pwritev( |
| 282 | fd: c_int, |
| 283 | iov: *const iovec, |
| 284 | iovcnt: c_int, |
| 285 | offset_lo: usize, |
| 286 | offset_hi: usize |
| 287 | ) via SYS_pwritev -> ssize_t |
| 288 | } |
| 289 | pwritev(fd, iov, iovcnt, offset as usize, (offset >> 32) as usize) |
| 290 | } |
| 291 | } |
| 292 | } |
| 293 | #[cfg(target_os = "android")] |
| 294 | pub(super) use readwrite_pv64::{preadv64 as preadv, pwritev64 as pwritev}; |