errno: Operating system error codes

This module defines symbolic constants that represent different operating system error conditions. The constant names (such as ENOENT) are equivalent to C errno symbolic error names. These constants can be mapped to integer errno values using CodeToErrno.

See also: The error values defined in this module are commonly encountered together with std::IoError objects.

Functions

CodeToErrno(code as Constant) as Int
Return the integer errno matching a symbolic constant from the below list. Return 0 if the errno value is not defined for the current operating system. Example:
CodeToErrno(ENOENT)  -- 2 (exact value may vary across operating systems)
ErrnoToCode(errno as Int) as Constant
Return a symbolic constant matching an integer errno value. Raise ValueError if no constant is defined for the current operating system, or if the constant is not in the below list. Example:
ErrnoToCode(2)   -- errno::ENOENT
ErrorStr(code as Constant) as Str
Return an error message describing a symbolic error code (in English). Return nil if no message is available for the code. Example:
ErrorStr(ENOENT)   -- "No such file or directory"

Symbolic constants

Each of these symbolic constants represents a potential errno value. All of these are defined even if the corresponding errno value is not defined for the current operating system.

E2BIG
Argument list too long
EACCES
Permission denied
EADDRINUSE
Address in use
EADDRNOTAVAIL
Local address not available
EAFNOSUPPORT
Address family not supported
EAGAIN
Resource temporarily unavailable
EBADF
Bad file descriptor
EBADFD
File descriptor in bad state
EBUSY
Resource busy
ECANCELED
Operation canceled
ECHILD
No child processes
ECOMM
Communication error on send
ECONNABORTED
Connection aborted
ECONNREFUSED
Connection refused
EDEADLK
Resource deadlock avoided
EDOM
Domain error
EEXIST
File exists
EFAULT
Bad address
EFBIG
File too large
EHOSTDOWN
Host is down
EHOSTUNREACH
Host in unreachable
EIDRM
Identifier removed
EILSEQ
Illegal byte sequence
EINPROGRESS
Operation in progress
EINTR
Interrupted function call
EINVAL
Invalid argument
EIO
Input/output error
EISCONN
Socket is connected
EISDIR
Is a directory
ELOOP
Too many levels of symbolic links
EMFILE
Too many open files
EMLINK
Too many links
EMSGSIZE
Message too long
ENAMETOOLONG
Filename too long
ENETDOWN
Network is down
ENETUNREACH
Network unreachable
ENFILE
Too many open files
ENODEV
No such device
ENOENT
No such file or directory
ENOEXEC
Exec format error
ENOLCK
No locks available
ENOLINK
Link has been severed
ENOMEM
Not enough space
ENOMSG
No message of the desired type
ENONET
Machine is not on the network
ENOPROTOOPT
Protocol not available
ENOSPC
No space left on device
ENOSR
No STREAM resources
ENOSTR
Not a STREAM
ENOSYS
Function not implemented
ENOTCONN
Socket is not connected
ENOTDIR
Not a directory
ENOTEMPTY
Directory not empty
ENOTSOCK
Not a socket
ENOTSUP
Operation not supported
ENOTTY
Inappropriate I/O control operation
ENOTUNIQ
Name not unique on network
ENXIO
No such device or address
EOPNOTSUPP
Operation not supported
EOVERFLOW
Value too large to be stored in data type
EPERM
Operation not permitted
EPIPE
Broken pipe
EPROTO
Protocol error
EPROTONOSUPPORT
Protocol not supported
EPROTOTYPE
Protocol wrong type for socket
ERANGE
Result too large
ERESTART
Interrupted system call should be restarted
EROFS
Read-only file system
ESPIPE
Invalid seek
ESRCH
No such process
ESTALE
Stale file handle
ETIME
Timer expired
ETIMEDOUT
Operation timed out
ETXTBSY
Text file busy
EWOULDBLOCK
Operation would block
EXDEV
Improper link