Source
pub fn preadv(fd: i32, iov: [*]const iovec, count: usize, offset: i64) usize {
const offset_u: u64 = @bitCast(offset);
return syscall5(
.preadv,
@as(usize, @bitCast(@as(isize, fd))),
@intFromPtr(iov),
count,
// Kernel expects the offset is split into largest natural word-size.
// See following link for detail:
// https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=601cc11d054ae4b5e9b5babec3d8e4667a2cb9b5
@as(usize, @truncate(offset_u)),
if (usize_bits < 64) @as(usize, @truncate(offset_u >> 32)) else 0,
);
}