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 › posix › ppoll Public Function ppoll Doc Source 1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047 pub fn ppoll (fds : []pollfd , timeout : ?*const timespec , mask : ?*const sigset_t ) PPollError !usize {
var ts : timespec = undefined ;
var ts_ptr : ?*timespec = null ;
if (timeout ) |timeout_ns | {
ts_ptr = &ts ;
ts = timeout_ns .*;
}
const fds_count = cast (nfds_t , fds .len ) orelse return error .SystemResources ;
const rc = system .ppoll (fds .ptr , fds_count , ts_ptr , mask );
switch (errno (rc )) {
.SUCCESS => return @intCast (rc ),
.FAULT => unreachable ,
.INTR => return error .SignalInterrupt ,
.INVAL => unreachable ,
.NOMEM => return error .SystemResources ,
else => |err | return unexpectedErrno (err ),
}
}