IsError v0.1.0
Tests whether a raw syscall result encodes a Linux error.
Package: Linux
Signature
func IsError(result: int64) -> bool;
Parameters
| Name | Type | Description |
|---|---|---|
result | int64 | Raw syscall return value. |
Returns
bool — true when result is in the Linux error range -4095 through
-1; otherwise false.
Example
import Linux::{ Errno, IsError, Read, StdIn };
func Main() -> int {
let result = Read(StdIn, buffer, capacity);
if IsError(result) {
let errorNumber = Errno(result);
}
return 0;
}
See also
Errno— convert an error result to positive errnoSyscall0–Syscall6— raw syscall entry points