class Errno
Overview
Errno wraps and gives access to libc's errno. This is mostly useful when dealing with C libraries.
This class is the exception thrown when errno errors are encountered.
Defined in:
errno.crConstant Summary
-
EACCES =
LibC::EACCES -
Cannot allocate memory
-
EADDRINUSE =
LibC::EADDRINUSE -
Address family not supported by protocol family
-
EADDRNOTAVAIL =
LibC::EADDRNOTAVAIL -
Address already in use
-
EAFNOSUPPORT =
LibC::EAFNOSUPPORT -
Protocol family not supported
-
EAGAIN =
LibC::EAGAIN -
Result too large
-
EALREADY =
LibC::EALREADY -
Operation now in progress
-
EBADF =
LibC::EBADF -
Exec format error
-
EBADMSG =
LibC::EBADMSG -
Illegal byte sequence
-
EBUSY =
LibC::EBUSY -
Block device required
-
ECANCELED =
LibC::ECANCELED -
Value too large to be stored in data type
-
ECHILD =
LibC::ECHILD -
Bad file descriptor
-
ECONNABORTED =
LibC::ECONNABORTED -
Network dropped connection on reset
-
ECONNREFUSED =
LibC::ECONNREFUSED -
Operation timed out
-
ECONNRESET =
LibC::ECONNRESET -
Software caused connection abort
-
EDEADLK =
LibC::EDEADLK -
No child processes
-
EDESTADDRREQ =
LibC::EDESTADDRREQ -
Socket operation on non-socket
-
EDOM =
LibC::EDOM -
Broken pipe
-
EDQUOT =
LibC::EDQUOT -
Too many users
-
EEXIST =
LibC::EEXIST -
Device / Resource busy
-
EFAULT =
LibC::EFAULT -
Permission denied
-
EFBIG =
LibC::EFBIG -
Text file busy
-
EHOSTDOWN =
LibC::EHOSTDOWN -
File name too long
-
EHOSTUNREACH =
LibC::EHOSTUNREACH -
Host is down
-
EIDRM =
LibC::EIDRM -
Operation canceled
-
EILSEQ =
LibC::EILSEQ -
No message of desired type
-
EINPROGRESS =
LibC::EINPROGRESS -
Operation would block
-
EINTR =
LibC::EINTR -
No such process
-
EINVAL =
LibC::EINVAL -
Is a directory
-
EIO =
LibC::EIO -
Interrupted system call
-
EISCONN =
LibC::EISCONN -
No buffer space available
-
EISDIR =
LibC::EISDIR -
Not a directory
-
ELOOP =
LibC::ELOOP -
Connection refused
-
EMFILE =
LibC::EMFILE -
Too many open files in system
-
EMLINK =
LibC::EMLINK -
Read-only file system
-
EMSGSIZE =
LibC::EMSGSIZE -
Destination address required
-
EMULTIHOP =
LibC::EMULTIHOP -
Bad message
-
ENAMETOOLONG =
LibC::ENAMETOOLONG -
Too many levels of symbolic links
-
ENETDOWN =
LibC::ENETDOWN -
Can't assign requested address
-
ENETRESET =
LibC::ENETRESET -
Network is unreachable
-
ENETUNREACH =
LibC::ENETUNREACH -
Network is down
-
ENFILE =
LibC::ENFILE -
Invalid argument
-
ENOBUFS =
LibC::ENOBUFS -
Connection reset by peer
-
ENODATA =
LibC::ENODATA -
Reserved
-
ENODEV =
LibC::ENODEV -
Cross-device link
-
ENOENT =
LibC::ENOENT -
Operation not permitted
-
ENOEXEC =
LibC::ENOEXEC -
Device not configured
-
ENOLCK =
LibC::ENOLCK -
Too many levels of remote in path
-
ENOLINK =
LibC::ENOLINK -
No message available on STREAM
-
ENOMEM =
LibC::ENOMEM -
Resource deadlock avoided
-
ENOMSG =
LibC::ENOMSG -
Identifier removed
-
ENOPROTOOPT =
LibC::ENOPROTOOPT -
Protocol wrong type for socket
-
ENOSPC =
LibC::ENOSPC -
File too large
-
ENOSR =
LibC::ENOSR -
Reserved
-
ENOSTR =
LibC::ENOSTR -
No STREAM resources
-
ENOSYS =
LibC::ENOSYS -
No locks available
-
ENOTBLK =
LibC::ENOTBLK -
Bad address
-
ENOTCONN =
LibC::ENOTCONN -
Socket is already connected
-
ENOTDIR =
LibC::ENOTDIR -
Operation not supported by device
-
ENOTEMPTY =
LibC::ENOTEMPTY -
No route to host
-
ENOTRECOVERABLE =
LibC::ENOTRECOVERABLE -
Operation not supported on socket
-
ENOTSOCK =
LibC::ENOTSOCK -
Operation already in progress
-
ENOTTY =
LibC::ENOTTY -
Too many open files
-
ENXIO =
LibC::ENXIO -
Input/output error
-
EOPNOTSUPP =
LibC::EOPNOTSUPP -
STREAM ioctl timeout
-
EOVERFLOW =
LibC::EOVERFLOW -
Function not implemented
-
EOWNERDEAD =
LibC::EOWNERDEAD -
State not recoverable
-
EPERM =
LibC::EPERM -
EPFNOSUPPORT =
LibC::EPFNOSUPPORT -
Socket type not supported
-
EPIPE =
LibC::EPIPE -
Too many links
-
EPROTO =
LibC::EPROTO -
Not a STREAM
-
EPROTONOSUPPORT =
LibC::EPROTONOSUPPORT -
Protocol not available
-
EPROTOTYPE =
LibC::EPROTOTYPE -
Message too long
-
ERANGE =
LibC::ERANGE -
Numerical argument out of domain
-
EREMOTE =
LibC::EREMOTE -
Stale NFS file handle
-
EROFS =
LibC::EROFS -
Illegal seek
-
ESHUTDOWN =
LibC::ESHUTDOWN -
Socket is not connected
-
ESOCKTNOSUPPORT =
LibC::ESOCKTNOSUPPORT -
Protocol not supported
-
ESPIPE =
LibC::ESPIPE -
No space left on device
-
ESRCH =
LibC::ESRCH -
No such file or directory
-
ESTALE =
LibC::ESTALE -
Disc quota exceeded
-
ETIME =
LibC::ETIME -
Protocol error
-
ETIMEDOUT =
LibC::ETIMEDOUT -
Too many references: can't splice
-
ETOOMANYREFS =
LibC::ETOOMANYREFS -
Can't send after socket shutdown
-
ETXTBSY =
LibC::ETXTBSY -
Inappropriate ioctl for device
-
EUSERS =
LibC::EUSERS -
Directory not empty
-
EWOULDBLOCK =
LibC::EWOULDBLOCK -
Resource temporarily unavailable
-
EXDEV =
LibC::EXDEV -
File exists
Class Method Summary
-
.value : LibC::Int
Returns the value of libc's errno.
-
.value=(value)
Sets the value of libc's errno.
-
.new(message)
Creates a new Errno with the given message.
Instance Method Summary
-
#errno : Int32
Returns the numeric value of errno.
Instance methods inherited from class Exception
backtrace
backtrace,
backtrace?
backtrace?,
callstack : CallStack | Nil
callstack,
callstack=(callstack : CallStack | Nil)
callstack=,
cause : Exception | Nil
cause,
inspect_with_backtrace(io : IO)inspect_with_backtrace inspect_with_backtrace, message : String | Nil message, to_s(io : IO) to_s
Class methods inherited from class Exception
new(message : String | Nil = nil, cause : Exception | Nil = nil)
new
Instance methods inherited from class Reference
==(other)==(other : self) ==, dup dup, hash hash, inspect(io : IO) : Nil inspect, object_id : UInt64 object_id, same?(other : Reference)
same?(other : Nil) same?, to_s(io : IO) : Nil to_s
Instance methods inherited from class Object
!=(other)
!=,
!~(other)
!~,
==(other)
==,
===(other)===(other : YAML::Any)
===(other : JSON::Any) ===, =~(other) =~, class class, crystal_type_id crystal_type_id, dup dup, hash hash, inspect(io : IO)
inspect inspect, itself itself, not_nil! not_nil!, tap(&block) tap, to_json to_json, to_pretty_json(io : IO)
to_pretty_json to_pretty_json, to_s
to_s(io : IO) to_s, to_yaml
to_yaml(io : IO) to_yaml, try(&block) try
Class methods inherited from class Object
==(other : Class)
==,
===(other)
===,
cast(other) : self
cast,
clone
clone,
dup
dup,
from_json(string_or_io, root : String) : selffrom_json(string_or_io) : self from_json, from_yaml(string : String) : self from_yaml, hash hash, inspect(io) inspect, name : String name, to_s(io) to_s, |(other : U.class) |
Class Method Detail
Creates a new Errno with the given message. The message will
have concatenated the message denoted by Errno#value.
Typical usage:
err = LibC.some_call
if err == -1
raise Errno.new("some_call")
end