Function init [src]
Alias for std.os.linux.errnoFromSyscall
Get the errno from a syscall return value, or 0 for no error.
The public API is exposed via the E namespace.
Prototype
fn errnoFromSyscall(r: usize) E
Parameters
r: usize
Source
fn errnoFromSyscall(r: usize) E {
const signed_r: isize = @bitCast(r);
const int = if (signed_r > -4096 and signed_r < 0) -signed_r else 0;
return @enumFromInt(int);
}