System Call Error Codes

The following codes are taken from <sys/errno.h>. The codes up to EPERM are the same values as those defined by ORCA/C for compatibility reasons. Error conditions are usually reported by system calls by returning a -1 (word) or NULL (long) value. Which error codes can be expected from a particular call are detailed in the errors section in the appropriate manual page.

EDOM
Domain error. Basically an undefined error code.
ERANGE
Range error. A value passed to a system call was too large, too small, or illegal.
ENOMEM
Not enough memory. The kernel could not allocate enough memory to complete the requested operation.
ENOENT
No such file or directory. The file specified could not be found.
EIO
I/O error. An error occurred trying to perform an I/O operation, such as that caused by bad media. It also refers to a disk error not covered by the other errno codes.
EINVAL
Invalid argument. An argument to a system call was invalid in some way.
EBADF
Bad file descriptor. The file descriptor passed to the kernel does not represent an open file.
EMFILE
Too many files are open. The kernel cannot open any more files for this process; it's open file table is full. Close some other open files and retry the operation.
EACCESS
Access bits prevent the operation. One of the access bit settings (delete, rename, read, write) associated with the file does not allow the requested operation.
EEXIST
The file exists. An attempt to create a new file with the same name as an existing file results in this error.
ENOSPC
No space on device. There is not enough room on the requested device to complete the operation. This is usually indicative of a full disk.
EPERM
Not owner. Not yet used in GNO.
ESRCH
No such process. The process ID specified does not refer to an active process. Possibly the process terminated earlier.
EINTR
Interrupted system call. Certain system calls can be interrupted by signals. In cases where the user has specified that those calls not be automatically restarted, the call will return this error.
E2BIG
Arg list too long. Too many arguments were specified in an _execve(2) call.
ENOEXEC
Exec format error. The file specified is not in an executable format (OMF load file).
ECHILD
No children. This error is returned by wait(2) when there are no child processes left running.
EAGAIN
No more processes. The process table is full, the fork(2) cannot complete.
ENOTDIR
Not a directory. One of the elements in a pathname refers to a file which is not a directory.
ENOTTY
Not a terminal. The file descriptor passed to an ioctl(2) or job control call does not refer to a terminal file.
EPIPE
Broken pipe. If a process attempts to write on a pipe with no readers, and has blocked or ignored SIGPIPE, this error is returned by the write operation.
ESPIPE
Illegal seek. Similar to ENOTBLK, but specific for pipes.
ENOTBLK
Not a block device. An attempt to perform an operation on a character device that only makes sense on a block device.

Feedback