Linux error numbers

时间:2023-12-23 15:18:08

Linux error numbers, straight from the horse's mouth.

#define EPERM            1      /* Operation not permitted */
#define ENOENT 2 /* No such file or directory */
#define ESRCH 3 /* No such process */
#define EINTR 4 /* Interrupted system call */
#define EIO 5 /* I/O error */
#define ENXIO 6 /* No such device or address */
#define E2BIG 7 /* Argument list too long */
#define ENOEXEC 8 /* Exec format error */
#define EBADF 9 /* Bad file number */
#define ECHILD 10 /* No child processes */
#define EAGAIN 11 /* Try again */
#define ENOMEM 12 /* Out of memory */
#define EACCES 13 /* Permission denied */
#define EFAULT 14 /* Bad address */
#define ENOTBLK 15 /* Block device required */
#define EBUSY 16 /* Device or resource busy */
#define EEXIST 17 /* File exists */
#define EXDEV 18 /* Cross-device link */
#define ENODEV 19 /* No such device */
#define ENOTDIR 20 /* Not a directory */
#define EISDIR 21 /* Is a directory */
#define EINVAL 22 /* Invalid argument */
#define ENFILE 23 /* File table overflow */
#define EMFILE 24 /* Too many open files */
#define ENOTTY 25 /* Not a typewriter */
#define ETXTBSY 26 /* Text file busy */
#define EFBIG 27 /* File too large */
#define ENOSPC 28 /* No space left on device */
#define ESPIPE 29 /* Illegal seek */
#define EROFS 30 /* Read-only file system */
#define EMLINK 31 /* Too many links */
#define EPIPE 32 /* Broken pipe */
#define EDOM 33 /* Math argument out of domain of func */
#define ERANGE 34 /* Math result not representable */
#define EDEADLK 35 /* Resource deadlock would occur */
#define ENAMETOOLONG 36 /* File name too long */
#define ENOLCK 37 /* No record locks available */
#define ENOSYS 38 /* Invalid system call number */
#define ENOTEMPTY 39 /* Directory not empty */
#define ELOOP 40 /* Too many symbolic links encountered */
#define EWOULDBLOCK EAGAIN /* Operation would block */
#define ENOMSG 42 /* No message of desired type */
#define EIDRM 43 /* Identifier removed */
#define ECHRNG 44 /* Channel number out of range */
#define EL2NSYNC 45 /* Level 2 not synchronized */
#define EL3HLT 46 /* Level 3 halted */
#define EL3RST 47 /* Level 3 reset */
#define ELNRNG 48 /* Link number out of range */
#define EUNATCH 49 /* Protocol driver not attached */
#define ENOCSI 50 /* No CSI structure available */
#define EL2HLT 51 /* Level 2 halted */
#define EBADE 52 /* Invalid exchange */
#define EBADR 53 /* Invalid request descriptor */
#define EXFULL 54 /* Exchange full */
#define ENOANO 55 /* No anode */
#define EBADRQC 56 /* Invalid request code */
#define EBADSLT 57 /* Invalid slot */
#define EDEADLOCK EDEADLK
#define EBFONT 59 /* Bad font file format */
#define ENOSTR 60 /* Device not a stream */
#define ENODATA 61 /* No data available */
#define ETIME 62 /* Timer expired */
#define ENOSR 63 /* Out of streams resources */
#define ENONET 64 /* Machine is not on the network */
#define ENOPKG 65 /* Package not installed */
#define EREMOTE 66 /* Object is remote */
#define ENOLINK 67 /* Link has been severed */
#define EADV 68 /* Advertise error */
#define ESRMNT 69 /* Srmount error */
#define ECOMM 70 /* Communication error on send */
#define EPROTO 71 /* Protocol error */
#define EMULTIHOP 72 /* Multihop attempted */
#define EDOTDOT 73 /* RFS specific error */
#define EBADMSG 74 /* Not a data message */
#define EOVERFLOW 75 /* Value too large for defined data type */
#define ENOTUNIQ 76 /* Name not unique on network */
#define EBADFD 77 /* File descriptor in bad state */
#define EREMCHG 78 /* Remote address changed */
#define ELIBACC 79 /* Can not access a needed shared library */
#define ELIBBAD 80 /* Accessing a corrupted shared library */
#define ELIBSCN 81 /* .lib section in a.out corrupted */
#define ELIBMAX 82 /* Attempting to link in too many shared libraries */
#define ELIBEXEC 83 /* Cannot exec a shared library directly */
#define EILSEQ 84 /* Illegal byte sequence */
#define ERESTART 85 /* Interrupted system call should be restarted */
#define ESTRPIPE 86 /* Streams pipe error */
#define EUSERS 87 /* Too many users */
#define ENOTSOCK 88 /* Socket operation on non-socket */
#define EDESTADDRREQ 89 /* Destination address required */
#define EMSGSIZE 90 /* Message too long */
#define EPROTOTYPE 91 /* Protocol wrong type for socket */
#define ENOPROTOOPT 92 /* Protocol not available */
#define EPROTONOSUPPORT 93 /* Protocol not supported */
#define ESOCKTNOSUPPORT 94 /* Socket type not supported */
#define EOPNOTSUPP 95 /* Operation not supported on transport endpoint */
#define EPFNOSUPPORT 96 /* Protocol family not supported */
#define EAFNOSUPPORT 97 /* Address family not supported by protocol */
#define EADDRINUSE 98 /* Address already in use */
#define EADDRNOTAVAIL 99 /* Cannot assign requested address */
#define ENETDOWN 100 /* Network is down */
#define ENETUNREACH 101 /* Network is unreachable */
#define ENETRESET 102 /* Network dropped connection because of reset */
#define ECONNABORTED 103 /* Software caused connection abort */
#define ECONNRESET 104 /* Connection reset by peer */
#define ENOBUFS 105 /* No buffer space available */
#define EISCONN 106 /* Transport endpoint is already connected */
#define ENOTCONN 107 /* Transport endpoint is not connected */
#define ESHUTDOWN 108 /* Cannot send after transport endpoint shutdown */
#define ETOOMANYREFS 109 /* Too many references: cannot splice */
#define ETIMEDOUT 110 /* Connection timed out */
#define ECONNREFUSED 111 /* Connection refused */
#define EHOSTDOWN 112 /* Host is down */
#define EHOSTUNREACH 113 /* No route to host */
#define EALREADY 114 /* Operation already in progress */
#define EINPROGRESS 115 /* Operation now in progress */
#define ESTALE 116 /* Stale file handle */
#define EUCLEAN 117 /* Structure needs cleaning */
#define ENOTNAM 118 /* Not a XENIX named type file */
#define ENAVAIL 119 /* No XENIX semaphores available */
#define EISNAM 120 /* Is a named type file */
#define EREMOTEIO 121 /* Remote I/O error */
#define EDQUOT 122 /* Quota exceeded */
#define ENOMEDIUM 123 /* No medium found */
#define EMEDIUMTYPE 124 /* Wrong medium type */
#define ECANCELED 125 /* Operation Canceled */
#define ENOKEY 126 /* Required key not available */
#define EKEYEXPIRED 127 /* Key has expired */
#define EKEYREVOKED 128 /* Key has been revoked */
#define EKEYREJECTED 129 /* Key was rejected by service */
#define EOWNERDEAD 130 /* Owner died */
#define ENOTRECOVERABLE 131 /* State not recoverable */
#define ERFKILL 132 /* Operation not possible due to RF-kill */
#define EHWPOISON 133 /* Memory page has hardware error */

The following is a complete list of the errors and their names as given in <sys/errno.h>.

 0 Undefined error: 0.  Not used.

 1 EPERM Operation not permitted.  An attempt was made to perform an oper-
ation limited to processes with appropriate privileges or to the
owner of a file or other resources. 2 ENOENT No such file or directory. A component of a specified pathname
did not exist, or the pathname was an empty string. 3 ESRCH No such process. No process could be found corresponding to that
specified by the given process ID. 4 EINTR Interrupted system call. An asynchronous signal (such as SIGINT
or SIGQUIT) was caught by the process during the execution of an
interruptible function. If the signal handler performs a normal
return, the interrupted system call will seem to have returned
the error condition. 5 EIO Input/output error. Some physical input or output error occurred.
This error will not be reported until a subsequent operation on
the same file descriptor and may be lost (over written) by any
subsequent errors. 6 ENXIO Device not configured. Input or output on a special file
referred to a device that did not exist, or made a request beyond
the limits of the device. This error may also occur when, for
example, a tape drive is not online or no disk pack is loaded on
a drive. 7 E2BIG Argument list too long. The number of bytes used for the argu-
ment and environment list of the new process exceeded the current
limit (NCARGS in <sys/param.h>). 8 ENOEXEC Exec format error. A request was made to execute a file that,
although it has the appropriate permissions, was not in the for-
mat required for an executable file. 9 EBADF Bad file descriptor. A file descriptor argument was out of
range, referred to no open file, or a read (write) request was
made to a file that was only open for writing (reading). 10 ECHILD No child processes. A wait(2) or waitpid(2) function was exe-
cuted by a process that had no existing or unwaited-for child
processes. 11 EDEADLK Resource deadlock avoided. An attempt was made to lock a sys-
tem resource that would have resulted in a deadlock situation. 12 ENOMEM Cannot allocate memory. The new process image required more
memory than was allowed by the hardware or by system-imposed mem-
ory management constraints. A lack of swap space is normally
temporary; however, a lack of core is not. Soft limits may be
increased to their corresponding hard limits. 13 EACCES Permission denied. An attempt was made to access a file in a
way forbidden by its file access permissions. 14 EFAULT Bad address. The system detected an invalid address in
attempting to use an argument of a call. 15 ENOTBLK Block device required. A block device operation was attempted
on a non-block device or file. 16 EBUSY Device busy. An attempt to use a system resource which was in
use at the time in a manner which would have conflicted with the
request. 17 EEXIST File exists. An existing file was mentioned in an inappropri-
ate context, for instance, as the new link name in a link(2) sys-
tem call. 18 EXDEV Cross-device link. A hard link to a file on another file system
was attempted. 19 ENODEV Operation not supported by device. An attempt was made to
apply an inappropriate function to a device, for example, trying
to read a write-only device such as a printer. 20 ENOTDIR Not a directory. A component of the specified pathname
existed, but it was not a directory, when a directory was
expected. 21 EISDIR Is a directory. An attempt was made to open a directory with
write mode specified. 22 EINVAL Invalid argument. Some invalid argument was supplied. (For
example, specifying an undefined signal to a signal(3) function
or a kill(2) system call). 23 ENFILE Too many open files in system. Maximum number of file descrip-
tors allowable on the system has been reached and a requests for
an open cannot be satisfied until at least one has been closed. 24 EMFILE Too many open files. (As released, the limit on the number of
open files per process is 64.) The getdtablesize(2) system call
will obtain the current limit. 25 ENOTTY Inappropriate ioctl for device. A control function (see
ioctl(2)) was attempted for a file or special device for which
the operation was inappropriate. 26 ETXTBSY Text file busy. The new process was a pure procedure (shared
text) file which was open for writing by another process, or
while the pure procedure file was being executed an open(2) call
requested write access. 27 EFBIG File too large. The size of a file exceeded the maximum. 28 ENOSPC No space left on device. A write(2) to an ordinary file, the
creation of a directory or symbolic link, or the creation of a
directory entry failed because no more disk blocks were available
on the file system, or the allocation of an inode for a newly
created file failed because no more inodes were available on the
file system. 29 ESPIPE Illegal seek. An lseek(2) system call was issued on a socket,
pipe or FIFO. 30 EROFS Read-only file system. An attempt was made to modify a file or
directory on a file system that was read-only at the time. 31 EMLINK Too many links. Maximum allowable hard links to a single file
has been exceeded (limit of 32767 hard links per file). 32 EPIPE Broken pipe. A write on a pipe, socket or FIFO for which there
is no process to read the data. 33 EDOM Numerical argument out of domain. A numerical input argument was
outside the defined domain of the mathematical function. 34 ERANGE Result too large. A numerical result of the function was too
large to fit in the available space (perhaps exceeded precision). 35 EAGAIN Resource temporarily unavailable. This is a temporary condi-
tion and later calls to the same routine may complete normally. 36 EINPROGRESS Operation now in progress. An operation that takes a long
time to complete (such as a connect(2)) was attempted on a non-
blocking object (see fcntl(2)). 37 EALREADY Operation already in progress. An operation was attempted on
a non-blocking object that already had an operation in progress. 38 ENOTSOCK Socket operation on non-socket. Self-explanatory. 39 EDESTADDRREQ Destination address required. A required address was
omitted from an operation on a socket. 40 EMSGSIZE Message too long. A message sent on a socket was larger than
the internal message buffer or some other network limit. 41 EPROTOTYPE Protocol wrong type for socket. A protocol was specified
that does not support the semantics of the socket type requested.
For example, you cannot use the ARPA Internet UDP protocol with
type SOCK_STREAM. 42 ENOPROTOOPT Protocol not available. A bad option or level was speci-
fied in a getsockopt(2) or setsockopt(2) call. 43 EPROTONOSUPPORT Protocol not supported. The protocol has not been
configured into the system or no implementation for it exists. 44 ESOCKTNOSUPPORT Socket type not supported. The support for the socket
type has not been configured into the system or no implementation
for it exists. 45 EOPNOTSUPP Operation not supported. The attempted operation is not
supported for the type of object referenced. Usually this occurs
when a file descriptor refers to a file or socket that cannot
support this operation, for example, trying to accept a connec-
tion on a datagram socket. 46 EPFNOSUPPORT Protocol family not supported. The protocol family has
not been configured into the system or no implementation for it
exists. 47 EAFNOSUPPORT Address family not supported by protocol family. An
address incompatible with the requested protocol was used. For
example, you should not necessarily expect to be able to use NS
addresses with ARPA Internet protocols. 48 EADDRINUSE Address already in use. Only one usage of each address is
normally permitted. 49 EADDRNOTAVAIL Cannot assign requested address. Normally results from
an attempt to create a socket with an address not on this
machine. 50 ENETDOWN Network is down. A socket operation encountered a dead net-
work. 51 ENETUNREACH Network is unreachable. A socket operation was attempted
to an unreachable network. 52 ENETRESET Network dropped connection on reset. The host you were con-
nected to crashed and rebooted. 53 ECONNABORTED Software caused connection abort. A connection abort was
caused internal to your host machine. 54 ECONNRESET Connection reset by peer. A connection was forcibly closed
by a peer. This normally results from a loss of the connection
on the remote socket due to a timeout or a reboot. 55 ENOBUFS No buffer space available. An operation on a socket or pipe
was not performed because the system lacked sufficient buffer
space or because a queue was full. 56 EISCONN Socket is already connected. A connect(2) request was made on
an already connected socket; or, a sendto(2) or sendmsg(2)
request on a connected socket specified a destination when
already connected. 57 ENOTCONN Socket is not connected. An request to send or receive data
was disallowed because the socket was not connected and (when
sending on a datagram socket) no address was supplied. 58 ESHUTDOWN Cannot send after socket shutdown. A request to send data
was disallowed because the socket had already been shut down with
a previous shutdown(2) call. 60 ETIMEDOUT Operation timed out. A connect(2) or send(2) request failed
because the connected party did not properly respond after a
period of time. (The timeout period is dependent on the communi-
cation protocol.) 61 ECONNREFUSED Connection refused. No connection could be made because
the target machine actively refused it. This usually results
from trying to connect to a service that is inactive on the for-
eign host. 62 ELOOP Too many levels of symbolic links. A path name lookup involved
more than 32 (MAXSYMLINKS) symbolic links. 63 ENAMETOOLONG File name too long. A component of a path name exceeded
{NAME_MAX} characters, or an entire path name exceeded {PATH_MAX}
characters. (See also the description of _PC_NO_TRUNC in
pathconf(2).) 64 EHOSTDOWN Host is down. A socket operation failed because the desti-
nation host was down. 65 EHOSTUNREACH No route to host. A socket operation was attempted to an
unreachable host. 66 ENOTEMPTY Directory not empty. A directory with entries other than
`.' and `..' was supplied to a remove directory or rename call. 67 EPROCLIM Too many processes. 68 EUSERS Too many users. The quota system ran out of table entries. 69 EDQUOT Disc quota exceeded. A write(2) to an ordinary file, the cre-
ation of a directory or symbolic link, or the creation of a
directory entry failed because the user's quota of disk blocks
was exhausted, or the allocation of an inode for a newly created
file failed because the user's quota of inodes was exhausted. 70 ESTALE Stale NFS file handle. An attempt was made to access an open
file (on an NFS file system) which is now unavailable as refer-
enced by the file descriptor. This may indicate the file was
deleted on the NFS server or some other catastrophic event
occurred. 72 EBADRPC RPC struct is bad. Exchange of RPC information was unsuccess-
ful. 73 ERPCMISMATCH RPC version wrong. The version of RPC on the remote peer
is not compatible with the local version. 74 EPROGUNAVAIL RPC prog. not avail. The requested program is not regis-
tered on the remote host. 75 EPROGMISMATCH Program version wrong. The requested version of the
program is not available on the remote host (RPC). 76 EPROCUNAVAIL Bad procedure for program. An RPC call was attempted for
a procedure which does not exist in the remote program. 77 ENOLCK No locks available. A system-imposed limit on the number of
simultaneous file locks was reached. 78 ENOSYS Function not implemented. Attempted a system call that is not
available on this system. 79 EFTYPE Inappropriate file type or format. The file was the wrong type
for the operation, or a data file had the wrong format. 80 EAUTH Authentication error. Attempted to use an invalid authentica-
tion ticket to mount a NFS file system. 81 ENEEDAUTH Need authenticator. An authentication ticket must be
obtained before the given NFS file system may be mounted. 82 EIDRM Identifier removed. An IPC identifier was removed while the
current process was waiting on it. 83 ENOMSG No message of desired type. An IPC message queue does not con-
tain a message of the desired type, or a message catalog does not
contain the requested message. 84 EOVERFLOW Value too large to be stored in data type. A numerical
result of the function was too large to be stored in the caller
provided space. 85 ECANCELED Operation canceled. The scheduled operation was canceled. 86 EILSEQ Illegal byte sequence. While decoding a multibyte character
the function came along an invalid or an incomplete sequence of
bytes or the given wide character is invalid. 87 ENOATTR Attribute not found. The specified extended attribute does
not exist. 88 EDOOFUS Programming error. A function or API is being abused in a way
which could only be detected at run-time.