Zig 0.17.0-dev (Split by item)

Shortcut keys
?
Show these tips
S
Focus search field
Esc
Clear focus & close tips
U
Jump to source code
↑
Move up in search results
↓
Move down in search results
↵
Go to active search result
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. Public Function

errno

Public Function
std.os.linux.errno
pub fn errno(r: u64) E

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

Params

  • r: u64

File

os/linux.zig:756
756
757
758
759
760
pub fn errno(r: u64) E {
    const signed_r: i32 = @bitCast(@as(u32, @truncate(r)));
    const int = if (signed_r > -4096 and signed_r < 0) -signed_r else 0;
    return @fromBackingInt(@intCast(int));
}