C++ Standard Library C++ STL Library

C++ - <cerrno> (errno.h)



The C++ <cerrno> header defines macro variable errno plus at least three additional macro constants: EDOM, ERANGE and EILSEQ. Along with this, the majority of the macros defined by this header file were adopted by C++11 available in POSIX environments.

These macros are available to use in a current program after including the header file using - #include <cerrno> or #include <errno.h>. All macros of this header file are listed below:

Library Macros

Macro variables

MacroDescription
errno macro which expands to POSIX-compatible thread-local error number variable.

Macro constants

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

Note: Although the header <cerrno> is based on the C standard library header <errno.h>, the majority of the macros defined by <cerrno> were adopted by C++ from the POSIX standard, rather than the C standard library.