feature. See also
. The project being documented here (as the example) is the Zig library itself.
linux.pwrite
pub fn pwrite(fd: fd_t, buf: [*]const u8, count: usize, offset: off_t) usize
File
Code
pub fn pwrite(fd: fd_t, buf: [*]const u8, count: usize, offset: off_t) usize {
if (@sizeOf(syscall_arg_t) < @sizeOf(u64)) {
const offset_halves = splitValue64(offset);
if (require_aligned_register_pair) {
return syscall6(
.pwrite64,
@as(u32, @bitCast(fd)),
@intFromPtr(buf),
count,
0,
offset_halves[0],
offset_halves[1],
);
} else {
return syscall5(
.pwrite64,
@as(u32, @bitCast(fd)),
@intFromPtr(buf),
count,
offset_halves[0],
offset_halves[1],
);
}
} else {
return syscall4(
.pwrite64,
@as(u32, @bitCast(fd)),
@intFromPtr(buf),
count,
@as(u64, @bitCast(offset)),
);
}
}