Errors v0.1.0
EPERM
pub const EPERM: int64 = 1;
EPERM: the operation is not permitted to this caller.
ENOENT
pub const ENOENT: int64 = 2;
ENOENT: no such file or directory.
ESRCH
pub const ESRCH: int64 = 3;
ESRCH: no such process.
EINTR
pub const EINTR: int64 = 4;
EINTR: the call was interrupted by a signal before it did anything.
EIO
pub const EIO: int64 = 5;
EIO: a low-level input or output error.
ENXIO
pub const ENXIO: int64 = 6;
ENXIO: no such device or address.
EBADF
pub const EBADF: int64 = 9;
EBADF: the file descriptor is not open, or is not open for what was asked.
EAGAIN
pub const EAGAIN: int64 = 35;
EAGAIN: the operation would block, and the descriptor was set not to.
ENOMEM
pub const ENOMEM: int64 = 12;
ENOMEM: not enough memory to satisfy the request.
EACCES
pub const EACCES: int64 = 13;
EACCES: permission denied.
EFAULT
pub const EFAULT: int64 = 14;
EFAULT: an address the call was given is outside the caller's address space.
EBUSY
pub const EBUSY: int64 = 16;
EBUSY: the resource is in use.
EEXIST
pub const EEXIST: int64 = 17;
EEXIST: the file already exists.
EXDEV
pub const EXDEV: int64 = 18;
EXDEV: the two paths are on different file systems.
ENOTDIR
pub const ENOTDIR: int64 = 20;
ENOTDIR: a path component that had to be a directory is not one.
EISDIR
pub const EISDIR: int64 = 21;
EISDIR: the target is a directory and the operation is not one a directory accepts.
EINVAL
pub const EINVAL: int64 = 22;
EINVAL: an argument is not valid.
EMFILE
pub const EMFILE: int64 = 24;
EMFILE: this process has too many descriptors open.
ENOSPC
pub const ENOSPC: int64 = 28;
ENOSPC: the device has no room left.
ESPIPE
pub const ESPIPE: int64 = 29;
ESPIPE: the descriptor is a pipe or socket and cannot be seeked.
EROFS
pub const EROFS: int64 = 30;
EROFS: the file system is mounted read-only.
EPIPE
pub const EPIPE: int64 = 32;
EPIPE: the reading end of the pipe is closed.
ENAMETOOLONG
pub const ENAMETOOLONG: int64 = 63;
ENAMETOOLONG: the path or a component of it is too long.
ELOOP
pub const ELOOP: int64 = 62;
ELOOP: too many symbolic links were followed resolving the path.
ENOSYS
pub const ENOSYS: int64 = 78;
ENOSYS: the kernel does not implement this call.
EOVERFLOW
pub const EOVERFLOW: int64 = 84;
EOVERFLOW: a value is too large for the type the call reports it in.
ETIMEDOUT
pub const ETIMEDOUT: int64 = 60;
ETIMEDOUT: the operation timed out.
MaximumErrno
pub const MaximumErrno: int64 = 4095;
The largest error number the normalized error range holds.
IsError
pub func IsError(result: int64) -> bool
Whether a raw system-call result is one of the normalized error values.
result is read by value. True for -4095 through -1, and false for everything else, including every valid
mapping address a memory call returns.
Cannot fail. Runs in constant time and allocates nothing.
Parameters
| Name | Type | Description |
|---|---|---|
result | int64 | the raw result to test |
Returns: whether it is one of the reserved error values
Errno
pub func Errno(result: int64) -> int64
The error number a raw system-call result carries, or zero when it carries none.
result is read by value; the number is returned by copy, positive, as a man page names it.
Cannot fail. Runs in constant time and allocates nothing.
Parameters
| Name | Type | Description |
|---|---|---|
result | int64 | the raw result to read |
Returns: the error number, positive, or zero when the result carries none