Zig 0.17.0-dev (Split by item) This is an example of documentation generated by
ZigDoc , an alternative to Zig's built-in
Auto Doc feature. See also
examples in other modes/formats . The project being documented here (as the example) is the Zig standard library.
std › os › linux › pwrite Public Function pwrite Doc Source Public Function std.os.linux.pwrite
pub fn pwrite (fd : fd_t , buf : [*]const u8 , count : usize , offset : off_t ) usize Params fd : fd_t buf : [*]const u8 count : usize offset : off_t File os/linux.zig: 1506
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538 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 )),
);
}
}