The Open Group Base Specifications Issue 7, 2018 edition
IEEE Std 1003.1-2017 (Revision of IEEE Std 1003.1-2008)
Copyright © 2001-2018 IEEE and The Open Group
A newer edition of this document exists here

NAME

errno.h - system error numbers

SYNOPSIS

#include <errno.h>

DESCRIPTION

[CX] [Option Start] Some of the functionality described on this reference page extends the ISO C standard. Any conflict between the requirements described here and the ISO C standard is unintentional. This volume of POSIX.1-2017 defers to the ISO C standard.

The ISO C standard only requires the symbols [EDOM], [EILSEQ], and [ERANGE] to be defined. [Option End]

The <errno.h> header shall provide a declaration or definition for errno. The symbol errno shall expand to a modifiable lvalue of type int. It is unspecified whether errno is a macro or an identifier declared with external linkage. If a macro definition is suppressed in order to access an actual object, or a program defines an identifier with the name errno, the behavior is undefined.

The <errno.h> header shall define the following macros which shall expand to integer constant expressions with type int, distinct positive values (except as noted below), and which shall be suitable for use in #if preprocessing directives:

[E2BIG]
Argument list too long.
[EACCES]
Permission denied.
[EADDRINUSE]
Address in use.
[EADDRNOTAVAIL]
Address not available.
[EAFNOSUPPORT]
Address family not supported.
[EAGAIN]
Resource unavailable, try again (may be the same value as [EWOULDBLOCK]).
[EALREADY]
Connection already in progress.
[EBADF]
Bad file descriptor.
[EBADMSG]
Bad message.
[EBUSY]
Device or resource busy.
[ECANCELED]
Operation canceled.
[ECHILD]
No child processes.
[ECONNABORTED]
Connection aborted.
[ECONNREFUSED]
Connection refused.
[ECONNRESET]
Connection reset.
[EDEADLK]
Resource deadlock would occur.
[EDESTADDRREQ]
Destination address required.
[EDOM]
Mathematics argument out of domain of function.
[EDQUOT]
Reserved.
[EEXIST]
File exists.
[EFAULT]
Bad address.
[EFBIG]
File too large.
[EHOSTUNREACH]
Host is unreachable.
[EIDRM]
Identifier removed.
[EILSEQ]
Illegal byte sequence.
[EINPROGRESS]
Operation in progress.
[EINTR]
Interrupted function.
[EINVAL]
Invalid argument.
[EIO]
I/O error.
[EISCONN]
Socket is connected.
[EISDIR]
Is a directory.
[ELOOP]
Too many levels of symbolic links.
[EMFILE]
File descriptor value too large.
[EMLINK]
Too many links.
[EMSGSIZE]
Message too large.
[EMULTIHOP]
Reserved.
[ENAMETOOLONG]
Filename too long.
[ENETDOWN]
Network is down.
[ENETRESET]
Connection aborted by network.
[ENETUNREACH]
Network unreachable.
[ENFILE]
Too many files open in system.
[ENOBUFS]
No buffer space available.
[ENODATA]
[OB XSR] [Option Start] No message is available on the STREAM head read queue. [Option End]
[ENODEV]
No such device.
[ENOENT]
No such file or directory.
[ENOEXEC]
Executable file format error.
[ENOLCK]
No locks available.
[ENOLINK]
Reserved.
[ENOMEM]
Not enough space.
[ENOMSG]
No message of the desired type.
[ENOPROTOOPT]
Protocol not available.
[ENOSPC]
No space left on device.
[ENOSR]
[OB XSR] [Option Start] No STREAM resources. [Option End]
[ENOSTR]
[OB XSR] [Option Start] Not a STREAM. [Option End]
[ENOSYS]
Functionality not supported.
[ENOTCONN]
The socket is not connected.
[ENOTDIR]
Not a directory or a symbolic link to a directory.
[ENOTEMPTY]
Directory not empty.
[ENOTRECOVERABLE]
State not recoverable.
[ENOTSOCK]
Not a socket.
[ENOTSUP]
Not supported (may be the same value as [EOPNOTSUPP]).
[ENOTTY]
Inappropriate I/O control operation.
[ENXIO]
No such device or address.
[EOPNOTSUPP]
Operation not supported on socket (may be the same value as [ENOTSUP]).
[EOVERFLOW]
Value too large to be stored in data type.
[EOWNERDEAD]
Previous owner died.
[EPERM]
Operation not permitted.
[EPIPE]
Broken pipe.
[EPROTO]
Protocol error.
[EPROTONOSUPPORT]
Protocol not supported.
[EPROTOTYPE]
Protocol wrong type for socket.
[ERANGE]
Result too large.
[EROFS]
Read-only file system.
[ESPIPE]
Invalid seek.
[ESRCH]
No such process.
[ESTALE]
Reserved.
[ETIME]
[OB XSR] [Option Start] Stream ioctl() timeout. [Option End]
[ETIMEDOUT]
Connection timed out.
[ETXTBSY]
Text file busy.
[EWOULDBLOCK]
Operation would block (may be the same value as [EAGAIN]).
[EXDEV]
Cross-device link.

The following sections are informative.

APPLICATION USAGE

Additional error numbers may be defined on conforming systems; see the System Interfaces volume of POSIX.1-2017.

RATIONALE

None.

FUTURE DIRECTIONS

None.

SEE ALSO

XSH Error Numbers

CHANGE HISTORY

First released in Issue 1. Derived from Issue 1 of the SVID.

Issue 5

Updated for alignment with the POSIX Realtime Extension.

Issue 6

The following new requirements on POSIX implementations derive from alignment with the Single UNIX Specification:

Values for errno are now required to be distinct positive values rather than non-zero values. This change is for alignment with the ISO/IEC 9899:1999 standard.

Issue 7

Austin Group Interpretation 1003.1-2001 #050 is applied, allowing [ENOTSUP] and [EOPNOTSUPP] to be the same values.

The [ENOTRECOVERABLE] and [EOWNERDEAD] errors are added from The Open Group Technical Standard, 2006, Extended API Set Part 2.

Functionality relating to the XSI STREAMS option is marked obsolescent.

Functionality relating to the Threads option is moved to the Base.

This reference page is clarified with respect to macros and symbolic constants.

POSIX.1-2008, Technical Corrigendum 1, XBD/TC1-2008/0043 [324] is applied.

POSIX.1-2008, Technical Corrigendum 2, XBD/TC2-2008/0059 [496] is applied.

End of informative text.

 

return to top of page

UNIX ® is a registered Trademark of The Open Group.
POSIX ™ is a Trademark of The IEEE.
Copyright © 2001-2018 IEEE and The Open Group, All Rights Reserved
[ Main Index | XBD | XSH | XCU | XRAT ]