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 library itself.

errno

Get the errno from a syscall return value. SUCCESS means no error.

plan9.errno
pub fn errno(r: usize) E

File

lib/std/os/plan9.zig:100

Code

pub fn errno(r: usize) E {
    const signed_r: isize = @bitCast(r);
    const int = if (signed_r > -4096 and signed_r < 0) -signed_r else 0;
    return @fromBackingInt(@intCast(int));
}