IsError v0.1.0

Source
Tests whether a raw syscall result encodes a Linux error.

Package: Linux

Signature

func IsError(result: int64) -> bool;

Parameters

NameTypeDescription
resultint64Raw syscall return value.

Returns

booltrue 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