int.
When a system call detects an error, it returns an integer value indicating failure (usually -1) and sets the variable errno accordingly. (This allows interpretation of the failure on receiving a -1 and to take action accordingly.) Successful calls never set errno; once set, it remains until another error occurs. It should only be examined after an error. Note that a number of system calls overload the meanings of these error numbers, and that the meanings must be interpreted according to the type and circumstances of the call.
The manual page for each system call will list some of the common errno codes that system call can return, but that should not be considered an exhaustive list, i.e. a properly written program should be able to gracefully recover from any error that a system call might return. Documenting all the error codes that a system call can return in a more specification-like manner would take more resources than this project has available.
The following is a complete list of the errors and their
names as given in
<errno.h>.
0 Error 01 EPERM Operation not permitted2 ENOENT No such file or directory3 ESRCH No such process4 EINTR Interrupted function callSIGINT
or
SIGQUIT)
was caught by the process during the execution of an interruptible
function.
If the signal handler performs a normal return, the
interrupted function call will seem to have returned the error condition.
5 EIO Input/output error6 ENXIO Device not configured7 E2BIG Arg list too longARG_MAX
in
<sys/syslimits.h>).
8 ENOEXEC Exec format error9 EBADF Bad file descriptor10 ECHILD No child processes11 EDEADLK Resource deadlock avoided12 ENOMEM Cannot allocate memory13 EACCES Permission denied14 EFAULT Bad address15 ENOTBLK Block device required16 EBUSY Resource busy17 EEXIST File exists18 EXDEV Improper link19 ENODEV Operation not supported by device20 ENOTDIR Not a directory21 EISDIR Is a directory22 EINVAL Invalid argument23 ENFILE Too many open files in system24 EMFILE Too many open files25 ENOTTY Inappropriate ioctl for device26 ETXTBSY Text file busy27 EFBIG File too large28 ENOSPC Device out of space29 ESPIPE Illegal seek30 EROFS Read-only file system31 EMLINK Too many links32 EPIPE Broken pipe33 EDOM Numerical argument out of domain34 ERANGE Result too large or too small35 EAGAIN Resource temporarily unavailable36 EINPROGRESS Operation now in progress37 EALREADY Operation already in progress38 ENOTSOCK Socket operation on non-socket39 EDESTADDRREQ Destination address required40 EMSGSIZE Message too long41 EPROTOTYPE Protocol wrong type for socketSOCK_STREAM.
42 ENOPROTOOPT Protocol option not available43 EPROTONOSUPPORT Protocol not supported44 ESOCKTNOSUPPORT Socket type not supported45 EOPNOTSUPP Operation not supported46 EPFNOSUPPORT Protocol family not supported47 EAFNOSUPPORT Address family not supported by protocol family48 EADDRINUSE Address already in use49 EADDRNOTAVAIL Cannot assign requested address50 ENETDOWN Network is down51 ENETUNREACH Network is unreachable52 ENETRESET Network dropped connection on reset53 ECONNABORTED Software caused connection abort54 ECONNRESET Connection reset by peer55 ENOBUFS No buffer space available56 EISCONN Socket is already connected57 ENOTCONN Socket is not connected58 ESHUTDOWN Cannot send after socket shutdown60 ETIMEDOUT Operation timed out61 ECONNREFUSED Connection refused62 ELOOP Too many levels of symbolic linksMAXSYMLINKS)
symbolic links.
63 ENAMETOOLONG File name too longMAXNAMELEN)
characters, or an entire
path name exceeded 1023
(MAXPATHLEN-1)
characters.
64 EHOSTDOWN Host is down65 EHOSTUNREACH No route to host66 ENOTEMPTY Directory not empty67 EPROCLIM Too many processes68 EUSERS Too many users69 EDQUOT Disc quota exceeded70 ESTALE Stale NFS file handle72 EBADRPC RPC struct is bad73 ERPCMISMATCH RPC version wrong74 EPROGUNAVAIL RPC prog. not avail75 EPROGMISMATCH Program version wrong76 EPROCUNAVAIL Bad procedure for program77 ENOLCK No locks available78 ENOSYS Function not implemented79 EFTYPE Inappropriate file type or format80 EAUTH Authentication error81 ENEEDAUTH Need authenticator82 EIDRM Identifier removed83 ENOMSG No message of the desired type84 EOVERFLOW Value too large to be stored in data type85 EILSEQ Illegal byte sequence86 ENOTSUP Not supported87 ECANCELED Operation canceled88 EBADMSG Bad or corrupt message89 ENODATA No message available90 ENOSR No STREAM resources91 ENOSTR Not a STREAM92 ETIME STREAM ioctl timeout93 ENOATTR Attribute not found94 EMULTIHOP Multihop attempted95 ENOLINK Link has been severed96 EPROTO Protocol errorEach user is also a member of one or more groups. One of these groups is distinguished from others and used in implementing accounting facilities. The positive integer corresponding to this distinguished group is termed the real group ID.
All processes have a real user ID and real group ID. These are initialized from the equivalent attributes of the process that created it.
The effective user ID and effective group ID are initially the process's real user ID and real group ID respectively. Either may be modified through execution of a set-user-ID or set-group-ID file (possibly by one its ancestors) (see execve(2)). By convention, the effective group ID (the first member of the group access list) is duplicated, so that the execution of a set-group-ID program does not result in the loss of the original (real) group ID.
The group access list is a set of group IDs used only in determining resource accessibility. Access checks are performed as described below in "File Access Permissions.
There are more machine-dependent kernel threads allocated by different drivers. See the specific driver manual pages for more information.
MAXNAMELEN)
characters may be used to name
an ordinary file, special file, or directory.
These characters may be selected from the set of all ASCII character excluding 0 (NUL) and the ASCII code for `/' (slash). (The parity bit, bit 7, must be 0).
Note that it is generally unwise to use `*', `?', `[' or `]' as part of file names because of the special meaning attached to these characters by the shell.
MAXPATHLEN)
characters.
If a path name begins with a slash, the path search begins at the root directory. Otherwise, the search begins from the current working directory. A slash by itself names the root directory. An empty string is not a valid pathname.
File access is broken down according to whether a file may be: read, written, or executed. Directory files use the execute permission to control if the directory may be searched.
File access permissions are interpreted by the system as they apply to three different classes of users: the owner of the file, those users in the file's group, anyone else. Every file has an independent set of access permissions for each of these classes. When an access check is made, the system decides if permission should be granted by checking the access information applicable to the caller.
Read, write, and execute/search permissions on a file are granted to a process if:
The process's effective user ID is that of the super-user. (Note: even the super-user cannot execute a non-executable file).
The process's effective user ID matches the user ID of the owner of the file and the owner permissions allow the access.
The process's effective user ID does not match the user ID of the owner of the file, and either the process's effective group ID matches the group ID of the file, or the group ID of the file is in the process's group access list, and the group permissions allow the access.
Neither the effective user ID nor effective group ID and group access list of the process match the corresponding user ID and group ID of the file, but the permissions for ``other users'' allow access.
Otherwise, permission is denied.
Sockets are typed according to their communications properties. These properties include whether messages sent and received at a socket require the name of the partner, whether communication is reliable, the format used in naming message recipients, etc.
Each instance of the system supports some collection of socket types; consult socket(2) for more information about the types available and their properties.
Each instance of the system supports some number of sets of communications protocols. Each protocol set supports addresses of a certain format. An Address Family is the set of addresses for a specific group of protocols. Each socket has an address chosen from the address family in which the socket was created.
AT&T UNIX.