errno.h

The errno.h header file defines the symbolic constants that are returned in the external variable errno.

Table 1. Definitions in errno.h
EACCES Permission denied
EADDRINUSE Address in use
EADDRNOTAVAIL Address not available
EADV Advertise error
EAFNOSUPPORT Address family not supported
EAGAIN Resource temporarily unavailable
EALREADY Connection already in progress
EBADF Bad file descriptor
EBADMSG Bad message
EBUSY Resource busy
ECANCELED Operation canceled
ECHILD No child processes
ECICS Function not supported under CICS®
ECOMM Communication error on send
ECONNABORTED Connection aborted
ECONNREFUSED Connection refused
ECONNRESET Connection reset
EDEADLK Resource deadlock avoided
EDESTADDRREQ Destination address required
EDOM Domain error
EDOTDOT Cross mount point (not an error)
EDQUOT Reserved
EEXIST File exists
EFAULT Bad address
EFBIG File too large
EHOSTDOWN Host is down
EHOSTUNREACH Destination host can not be reached
EIBMBADCALL A bad socket-call constant in IUCV header
EIBMBADPARM Other IUCV header error
EIBMCANCELLED Request canceled
EIBMCONFLICT Conflicting call outstanding on socket
EIBMIUCVERR Request failed due to IUCV error
EIBMSOCKINUSE Assigned socket number already in use
EIBMSOCKOUTOFRANGE Assigned socket number out of range
EIDRM Identifier removed
EILSEQ Illegal byte sequence
EINPROGRESS Connection in progress
EINTR Interrupted function call
EINTRNODATA Function call interrupted before any data received
EINVAL Invalid argument
EIO Input/output error
EISCONN Socket is already connected
EISDIR Is a directory
ELEMSGERR Message file was not found in the hierarchical file system
ELEMULTITHREAD Function not allowed in a multithreaded environment
ELEMULTITHREADFORK Function not allowed in child of fork() in multithreaded environment
ELENOFORK Language Environment member language cannot tolerate a fork()
ELOOP A loop exists in symbolic links encountered during resolution of the path argument
EMFILE Too many open files
EMLINK Too many links
EMSGSIZE Message too long
EMULTIHOP Multihop is not allowed
EMVSBADCHAR Bad character in environment variable name
EMVSCATLG Catalog obtain error
EMVSCPLERROR A CPL service failed
EMVSCVAF Catalog Volume Access Facility error
EMVSDYNALC Dynamic allocation error
EMVSERR An MVS™ internal error
EMVSEXPIRE Password has expired
EMVSINITIAL Process initialization err
EMVSNORTL Access to the z/OS® UNIX version of the C RTL is denied
EMVSNOTXP z/OS UNIX are not active
EMVSPARM Bad parameters were passed to the service
EMVSPASSWORD Password is invalid
EMVSPATHOPTS Access mode argument conflicts with PATHOPTS parameter
EMVSPFSFILE PDSE/X encountered a permanent file error
EMVSPFSPERM PDSE/X encountered a system error
EMVSSAF2ERR SAF/RACF error
EMVSSAFEXTRERR SAF/RACF extract error
EMVSTODNOTSET System TOD clock not set
ENAMETOOLONG File name too long
ENETDOWN The local interface to use or reach the destination
ENETRESET Network dropped connection on reset
ENETUNREACH Network unreachable
ENFILE Too many open files in system
ENOBUFS No buffer space available
ENODATA No message available
ENODEV No such device
ENOENT No such file or directory
ENOEXEC Exec format error
ENOLINK The link has been severed
ENOLCK No locks available
ENOMEM Not enough space
ENOMSG No message of desired type
ENONET Machine is not on the network
ENOPROTOOPT Protocol not available
ENOREUSE The socket cannot be reused
ENOSPC No space left on device
ENOSR No stream resource
ENOSYS Function not implemented
ENOSTR Not a stream
ENOTBLK Block device required
ENOTCONN The socket is not connected.
ENOTDIR Not a directory
ENOTEMPTY Directory not empty
ENOTSOCK Descriptor does not refer to a socket
ENOTSUP Not supported.
ENOTTY Inappropriate I/O control operation
ENXIO No such device or address
EOFFLOADboxDOWN Offload box down
EOFFLOADboxERROR Offload box error
EOFFLOADboxRESTART Offload box restarted
EOPNOTSUPP Operation not supported on socket
EOVERFLOW Value too large to be stored in data type
EPERM Operation not permitted
EPFNOSUPPORT Protocol family not supported
EPIPE Broken pipe
EPROCLIM Too many processes
EPROTO Protocol error
EPROTONOSUPPORT Protocol not supported
EPROTOTYPE The socket type is not supported by the protocol
ERANGE Range error or pole error
EREMCHG Remote address changed
EREMOTE Too many levels of remote in path
EROFS Read-only file system
ERREMOTE Object is remote
ESHUTDOWN Cannot send after socket shutdown
ESOCKTNOSUPPORT Socket type not supported
ESPIPE Invalid seek
ESRCH No such process
ESRMNT srmount error
ESTALE The file handle is stale
ETIME Stream ioctl() timeout
ETIMEDOUT Socket not connected
ETOOMANYREFS Too many references: cannot splice
ETXTBSY Text file busy
EUSERS Too many users
EWOULDBLOCK Problem on nonblocking socket
EXDEV A link to a file on another file system was attempted
E2BIG Argument list too long

The errno.h header file also defines errno, which is a modifiable lvalue having type int. If you intend to test the value of errno after library function calls, first set it to 0, because the library functions do not reset the value to 0.

strerror() or perror() functions can be used to print the description of the message associated with a particular errno.

To test for the explicit error, use the macro names defined in errno.h, rather than specific values of these macros. Doing so will ensure future compatibility and portability.

errno.h also declares the __errno2() prototype.