This section describes all of the system calls. Most of these calls return one or more error conditions. An error condition is indicated by an otherwise impossible return value. This is almost always -1 or the null pointer; the individual descriptions specify the details.
An error number is also made available in the external variable errno, which is not cleared on successful calls, so it should be tested only after an error has been indicated.
In the case of multithreaded applications, the -mt option must be specified on the command line at compilation time (see threads(3THR)).
When the -mt option is specified, errno becomes a macro that enables each thread to have its own errno. This errno macro can be used on either side of the assignment as though it were a variable.
Each system call description attempts to list all possible error numbers. The following is a complete list of the error numbers and their names as defined in <errno.h>.
- 1 EPERM
- Not superuser
Typically this error indicates an attempt to modify a file in some way forbidden except to its owner or the super-user. It is also returned for attempts by ordinary users to do things allowed only to the super-user.
- 2 ENOENT
- No such file or directory
A file name is specified and the file should exist but doesn't, or one of the directories in a path name does not exist.
- 3 ESRCH
- No such process, LWP, or thread
No process can be found in the system that corresponds to the specified PID, LWPID_t, or thread_t.
- 4 EINTR
- Interrupted system call
An asynchronous signal (such as interrupt or quit), which the user has elected to catch, occurred during a system service function. If execution is resumed after processing the signal, it will appear as if the interrupted function call returned this error condition.
In a multithreaded application, EINTR may be returned whenever another thread or LWP calls fork(2).
- 5 EIO
- I/O error
Some physical I/O error has occurred. This error may in some cases occur on a call following the one to which it actually applies.
- 6 ENXIO
- No such device or address
I/O on a special file refers to a subdevice which does not exist, or exists beyond the limit of the device. It may also occur when, for example, a tape drive is not on-line or no disk pack is loaded on a drive.
- 7 E2BIG
- Arg list too long
An argument list longer than ARG_MAX bytes is presented to a member of the exec family of functions (see exec(2)). The argument
list limit is the sum of the size of the argument list plus the size of the environment's exported shell variables.
- 8 ENOEXEC
- Exec format error
A request is made to execute a file which, although it has the appropriate permissions, does not start with a valid format (see a.out(4)).
- 9 EBADF
- Bad file number
Either a file descriptor refers to no open file, or a read(2) (respectively, write(2))
request is made to a file that is open only for writing (respectively, reading).
- 10 ECHILD
- No child processes
A wait(2) function was executed by a process that had no existing or unwaited-for child processes.
- 11 EAGAIN
- No more processes, or no more LWPs
For example, the fork(2) function failed because the system's process table is full or the user is not allowed to create any more processes, or a call failed because of insufficient memory
or swap space.
- 12 ENOMEM
- Not enough space
During execution of brk() or sbrk() (see brk(2)), or one of the exec family of functions, a program asks for more space than the
system is able to supply. This is not a temporary condition; the maximum size is a system parameter. On some architectures, the error may also occur if the arrangement of text, data, and stack segments requires too many segmentation registers, or if there is not enough swap space during the fork(2) function. If this error occurs on a resource associated with Remote File Sharing (RFS), it indicates a memory depletion which may be temporary, dependent on system activity at the time the call was invoked.
- 13 EACCES
- Permission denied
An attempt was made to access a file in a way forbidden by the protection system.
- 14 EFAULT
- Bad address
The system encountered a hardware fault in attempting to use an argument of a routine. For example, errno potentially may be set to EFAULT any time a routine that takes a pointer argument is passed an invalid address, if the system can detect the condition.
Because systems will differ in their ability to reliably detect a bad address, on some implementations passing a bad address to a routine will result in undefined behavior.
- 15 ENOTBLK
- Block device required
A non-block device or file was mentioned where a block device was required (for example, in a call to the mount(2) function).
- 16 EBUSY
- Device busy
An attempt was made to mount a device that was already mounted or an attempt was made to unmount a device on which there is an active file (open file, current directory, mounted-on file, active text segment). It will also occur if an attempt is made to enable accounting when it is already enabled.
The device or resource is currently unavailable. EBUSY is also used by mutexes, semaphores, condition variables, and r/w locks, to indicate that a lock is held, and by the processor control function P_ONLINE.
- 17 EEXIST
- File exists
An existing file was mentioned in an inappropriate context (for example, call to the link(2) function).
- 18 EXDEV
- Cross-device link
A hard link to a file on another device was attempted.
- 19 ENODEV
- No such device
An attempt was made to apply an inappropriate operation to a device (for example, read a write-only device).
- 20 ENOTDIR
- Not a directory
A non-directory was specified where a directory is required (for example, in a path prefix or as an argument to the chdir(2) function).
- 21 EISDIR
- Is a directory
An attempt was made to write on a directory.
- 22 EINVAL
- Invalid argument
An invalid argument was specified (for example, unmounting a non-mounted device), mentioning an undefined signal in a call to the signal(3C) or kill(2) function, or an unsupported operation related to extended attributes was attempted.
- 23 ENFILE
- File table overflow
The system file table is full (that is, SYS_OPEN files are open, and temporarily no more files can be opened).
- 24 EMFILE
- Too many open files
No process may have more than OPEN_MAX file descriptors open at a time.
- 25 ENOTTY
- Inappropriate ioctl for device
A call was made to the ioctl(2) function specifying a file that is not a special character device.
- 26 ETXTBSY
- Text file busy (obselete)
An attempt was made to execute a pure-procedure program that is currently open for writing. Also an attempt to open for writing or to remove a pure-procedure program that is being executed. (This message is obsolete.)
- 27 EFBIG
- File too large
The size of the file exceeded the limit specified by resource RLIMIT_FSIZE ; the file size exceeds the maximum supported by the file system; or the file size exceeds the offset maximum of the file descriptor. See the File Descriptor subsection of the DEFINITIONS section below.
- 28 ENOSPC
- No space left on device
While writing an ordinary file or creating a directory entry, there is no free space left on the device. In the fcntl(2) function, the setting or removing of record locks on a file cannot
be accomplished because there are no more record entries left on the system.
- 29 ESPIPE
- Illegal seek
A call to the lseek(2) function was issued to a pipe.
- 30 EROFS
- Read-only file system
An attempt to modify a file or directory was made on a device mounted read-only.
- 31 EMLINK
- Too many links
An attempt to make more than the maximum number of links, LINK_MAX, to a file.
- 32 EPIPE
- Broken pipe
A write on a pipe for which there is no process to read the data. This condition normally generates a signal; the error is returned if the signal is ignored.
- 33 EDOM
- Math argument out of domain of function
The argument of a function in the math package (3M) is out of the domain of the function.
- 34 ERANGE
- Math result not representable
The value of a function in the math package (3M) is not representable within machine precision.
- 35 ENOMSG
- No message of desired type
An attempt was made to receive a message of a type that does not exist on the specified message queue (see msgrcv(2)).
- 36 EIDRM
- Identifier removed
This error is returned to processes that resume execution due to the removal of an identifier from the file system's name space (see msgctl(2), semctl(2), and shmctl(2)).
- 37 ECHRNG
- Channel number out of range
- 38 EL2NSYNC
- Level 2 not synchronized
- 39 EL3HLT
- Level 3 halted
- 40 EL3RST
- Level 3 reset
- 41 ELNRNG
- Link number out of range
- 42 EUNATCH
- Protocol driver not attached
- 43 ENOCSI
- No CSI structure available
- 44 EL2HLT
- Level 2 halted
- 45 EDEADLK
- Deadlock condition
A deadlock situation was detected and avoided. This error pertains to file and record locking, and also applies to mutexes, semaphores, condition variables, and r/w locks.
- 46 ENOLCK
- No record locks available
There are no more locks available. The system lock table is full (see fcntl(2)).
- 47 ECANCELED
- Operation canceled
The associated asynchronous operation was canceled before completion.
- 48 ENOTSUP
- Not supported
This version of the system does not support this feature. Future versions of the system may provide support.
- 49 EDQUOT
- Disc quota exceeded
A write(2) to an ordinary file, the creation 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.
- 60 ENOSTR
- Device not a stream
A putmsg(2) or getmsg(2) call was attempted on a file descriptor that
is not a STREAMS device.
- 61 ENODATA
- No data available
- 62 ETIME
- Timer expired
The timer set for a STREAMS ioctl(2) call has expired. The cause of this error is device-specific and could indicate either a hardware or software failure, or perhaps a timeout value that
is too short for the specific operation. The status of the ioctl() operation is indeterminate. This is also returned in the case of _lwp_cond_timedwait(2) or cond_timedwait(3THR).
- 63 ENOSR
- Out of stream resources
During a STREAMS open(2) call, either no STREAMS queues or no STREAMS head data structures
were available. This is a temporary condition; one may recover from it if other processes release resources.
- 64 ENONET
- Machine is not on the network
This error is Remote File Sharing (RFS) specific. It occurs when users try to advertise, unadvertise, mount, or unmount remote resources while the machine has not done the proper startup to connect to the network.
- 65 ENOPKG
- Package not installed
This error occurs when users attempt to use a call from a package which has not been installed.
- 66 EREMOTE
- Object is remote
This error is RFS-specific. It occurs when users try to advertise a resource which is not on the local machine, or try to mount/unmount a device (or pathname) that is on a remote machine.
- 67 ENOLINK
- Link has been severed
This error is RFS-specific. It occurs when the link (virtual circuit) connecting to a remote machine is gone.
- 68 EADV
- Advertise error
This error is RFS-specific. It occurs when users try to advertise a resource which has been advertised already, or try to stop RFS while there are resources still advertised, or try to force unmount a resource when it is still advertised.
- 69 ESRMNT
- Srmount error
This error is RFS-specific. It occurs when an attempt is made to stop RFS while resources are still mounted by remote machines, or when a resource is readvertised with a client list that does not include a remote machine that currently has the resource mounted.
- 70 ECOMM
- Communication error on send
This error is RFS-specific. It occurs when the current process is waiting for a message from a remote machine, and the virtual circuit fails.
- 71 EPROTO
- Protocol error
Some protocol error occurred. This error is device-specific, but is generally not related to a hardware failure.
- 76 EDOTDOT
- Error 76
This error is RFS-specific. A way for the server to tell the client that a process has transferred back from mount point.
- 77 EBADMSG
- Not a data message
During a read(2), getmsg(2), or ioctl(2) I_RECVFD call to a STREAMS device, something has come to the head of the queue that can not be processed. That something depends on the call:
- control information or passed file descriptor.
- passed file descriptor.
- control or data information.
- 78 ENAMETOOLONG
- File name too long
The length of the path argument exceeds PATH_MAX, or the length of a path component exceeds NAME_MAX while _POSIX_NO_TRUNC is in effect; see limits(4).
- 79 EOVERFLOW
- Value too large for defined data type.
- 80 ENOTUNIQ
- Name not unique on network
Given log name not unique.
- 81 EBADFD
- File descriptor in bad state
Either a file descriptor refers to no open file or a read request was made to a file that is open only for writing.
- 82 EREMCHG
- Remote address changed
- 83 ELIBACC
- Cannot access a needed share library
Trying to exec an a.out that requires a static shared library and the static shared library does not exist or the user does not have permission to use it.
- 84 ELIBBAD
- Accessing a corrupted shared library
Trying to exec an a.out that requires a static shared library (to be linked in) and exec could not load the static shared library. The static shared library is probably corrupted.
- 85 ELIBSCN
.lib section in a.out corrupted
Trying to exec an a.out that requires a static shared library (to be linked in) and there was erroneous data in the .lib section of the a.out. The .lib section tells exec what static
shared libraries are needed. The a.out is probably corrupted.
- 86 ELIBMAX
- Attempting to link in more shared libraries than system limit
Trying to exec an a.out that requires more static shared libraries than is allowed on the current configuration of the system. See System Administration Guide: IP Services
- 87 ELIBEXEC
- Cannot exec a shared library directly
Attempting to exec a shared library directly.
- 88 EILSEQ
- Error 88
Illegal byte sequence. Handle multiple characters as a single character.
- 89 ENOSYS
- Operation not applicable
- 90 ELOOP
- Number of symbolic links encountered during path name traversal exceeds MAXSYMLINKS
- 91 ESTART
- Restartable system call
Interrupted system call should be restarted.
- 92 ESTRPIPE
- If pipe/FIFO, don't sleep in stream head
Streams pipe error (not externally visible).
- 93 ENOTEMPTY
- Directory not empty
- 94 EUSERS
- Too many users
- 95 ENOTSOCK
- Socket operation on non-socket
- 96 EDESTADDRREQ
- Destination address required
A required address was omitted from an operation on a transport endpoint. Destination address required.
- 97 EMGSIZE
- Message too long
A message sent on a transport provider was larger than the internal message buffer or some other network limit.
- 98 EPROTOTYPE
- Protocol wrong type for socket
A protocol was specified that does not support the semantics of the socket type requested.
- 99 ENOPROTOOPT
- Protocol not available
A bad option or level was specified when getting or setting options for a protocol.
- 120 EPROTONOSUPPORT
- Protocol not supported
The protocol has not been configured into the system or no implementation for it exists.
- 121 ESOCKTNOSUPPORT
- Socket type not supported
The support for the socket type has not been configured into the system or no implementation for it exists.
- 122 EOPNOTSUPP
- Operation not supported on transport endpoint
For example, trying to accept a connection on a datagram transport endpoint.
- 123 EPFNOSUPPORT
- Protocol family not supported
The protocol family has not been configured into the system or no implementation for it exists. Used for the Internet protocols.
- 124 EAFNOSUPPORT
- Address family not supported by protocol family
An address incompatible with the requested protocol was used.
- 125 EADDRINUSE
- Address already in use
User attempted to use an address already in use, and the protocol does not allow this.
- 126 EADDRNOTAVAIL
- Cannot assign requested address
Results from an attempt to create a transport endpoint with an address not on the current machine.
- 127 ENETDOWN
- Network is down
Operation encountered a dead network.
- 128 ENETUNREACH
- Network is unreachable
Operation was attempted to an unreachable network.
- 129 ENETRESET
- Network dropped connection because of reset
The host you were connected to crashed and rebooted.
- 130 ECONNABORTED
- Software caused connection abort
A connection abort was caused internal to your host machine.
- 131 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 host due to a timeout or a reboot.
- 132 ENOBUFS
- No buffer space available
An operation on a transport endpoint or pipe was not performed because the system lacked sufficient buffer space or because a queue was full.
- 133 EISCONN
- Transport endpoint is already connected
A connect request was made on an already connected transport endpoint; or, a sendto(3SOCKET) or sendmsg(3SOCKET) request on a connected transport endpoint specified a destination when already connected.
- 134 ENOTCONN
- Transport endpoint is not connected
A request to send or receive data was disallowed because the transport endpoint is not connected and (when sending a datagram) no address was supplied.
- 143 ESHUTDOWN
- Cannot send after transport endpoint shutdown
A request to send data was disallowed because the transport endpoint has already been shut down.
- 144 ETOOMANYREFS
- Too many references: cannot splice
- 145 ETIMEDOUT
- Connection timed out
A connect(3SOCKET) or send(3SOCKET) request failed because the connected party did not properly respond after a period of time; or a write(2) or fsync(3C) request failed because a file is on an NFS file system mounted with the soft option.
- 146 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 remote host.
- 147 EHOSTDOWN
- Host is down
A transport provider operation failed because the destination host was down.
- 148 EHOSTUNREACH
- No route to host
A transport provider operation was attempted to an unreachable host.
- 149 EALREADY
- Operation already in progress
An operation was attempted on a non-blocking object that already had an operation in progress.
- 150 EINPROGRESS
- Operation now in progress
An operation that takes a long time to complete (such as a connect()) was attempted on a non-blocking object.
- 151 ESTALE
- Stale NFS file handle