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 › pread Public Function pread Doc Source Public Function std.os.linux.pread
pub fn pread (fd : fd_t , buf : [*]u8 , count : usize , offset : off_t ) usize Params fd : fd_t buf : [*]u8 count : usize offset : off_t File os/linux.zig: 1435
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467 pub fn pread (fd : fd_t , buf : [*]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 (
.pread64 ,
@as (u32 , @bitCast (fd )),
@intFromPtr (buf ),
count ,
0 ,
offset_halves [0 ],
offset_halves [1 ],
);
} else {
return syscall5 (
.pread64 ,
@as (u32 , @bitCast (fd )),
@intFromPtr (buf ),
count ,
offset_halves [0 ],
offset_halves [1 ],
);
}
} else {
return syscall4 (
.pread64 ,
@as (u32 , @bitCast (fd )),
@intFromPtr (buf ),
count ,
@as (u64 , @bitCast (offset )),
);
}
}