Skip to content

Latest commit

 

History

History
117 lines (105 loc) · 9.69 KB

errno-constants.md

File metadata and controls

117 lines (105 loc) · 9.69 KB
descriptiontitlems.datef1_keywordshelpviewer_keywords
Learn more about: errno constants
errno constants
04/26/2021
E2BIG
EACCES
EAGAIN
EBADF
EBUSY
ECHILD
EDEADLK
EDEADLOCK
EDOM
EEXIST
EFAULT
EFBIG
EILSEQ
EINTR
EINVAL
EIO
EISDIR
EMFILE
EMLINK
ENAMETOOLONG
ENFILE
ENODEV
ENOENT
ENOEXEC
ENOLCK
ENOMEM
ENOSPC
ENOSYS
ENOTDIR
ENOTEMPTY
ENOTTY
ENXIO
EPERM
EPIPE
ERANGE
EROFS
ESPIPE
ESRCH
EXDEV
STRUNCATE
EADDRINUSE
EADDRNOTAVAIL
EAFNOSUPPORT
EALREADY
EBADMSG
ECANCELED
ECONNABORTED
ECONNREFUSED
ECONNRESET
EDESTADDRREQ
EHOSTUNREACH
EIDRM
EINPROGRESS
EISCONN
ELOOP
EMSGSIZE
ENETDOWN
ENETRESET
ENETUNREACH
ENOBUFS
ENODATA
ENOLINK
ENOMSG
ENOPROTOOPT
ENOSR
ENOSTR
ENOTCONN
ENOTRECOVERABLE
ENOTSOCK
ENOTSUP
EOPNOTSUPP
EOTHER
EOVERFLOW
EOWNERDEAD
EPROTO
EPROTONOSUPPORT
EPROTOTYPE
ETIME
ETIMEDOUT
ETXTBSY
EWOULDBLOCK
E2BIG constant
EACCES constant
EAGAIN constant
EBADF constant
EBUSY constant
ECHILD constant
EDEADLK constant
EDEADLOCK constant
EDOM constant
EEXIST constant
EFAULT constant
EFBIG constant
EILSEQ constant
EINTR constant
EINVAL constant
EIO constant
EISDIR constant
EMFILE constant
EMLINK constant
ENAMETOOLONG constant
ENFILE constant
ENODEV constant
ENOENT constant
ENOEXEC constant
ENOLCK constant
ENOMEM constant
ENOSPC constant
ENOSYS constant
ENOTDIR constant
ENOTEMPTY constant
ENOTTY constant
ENXIO constant
EPERM constant
EPIPE constant
ERANGE constant
EROFS constant
ESPIPE constant
ESRCH constant
EXDEV constant
STRUNCATE constant
EADDRINUSE constant
EADDRNOTAVAIL constant
EAFNOSUPPORT constant
EALREADY constant
EBADMSG constant
ECANCELED constant
ECONNABORTED constant
ECONNREFUSED constant
ECONNRESET constant
EDESTADDRREQ constant
EHOSTUNREACH constant
EIDRM constant
EINPROGRESS constant
EISCONN constant
ELOOP constant
EMSGSIZE constant
ENETDOWN constant
ENETRESET constant
ENETUNREACH constant
ENOBUFS constant
ENODATA constant
ENOLINK constant
ENOMSG constant
ENOPROTOOPT constant
ENOSR constant
ENOSTR constant
ENOTCONN constant
ENOTRECOVERABLE constant
ENOTSOCK constant
ENOTSUP constant
EOPNOTSUPP constant
EOTHER constant
EOVERFLOW constant
EOWNERDEAD constant
EPROTO constant
EPROTONOSUPPORT constant
EPROTOTYPE constant
ETIME constant
ETIMEDOUT constant
ETXTBSY constant
EWOULDBLOCK constant

errno constants

Syntax

#include<errno.h>

Remarks

The errno constants are values assigned to errno for various error conditions.

ERRNO.H contains the definitions of the errno values. However, not all the definitions given in ERRNO.H are used in 32-bit Windows operating systems. Some of the values in ERRNO.H are present to maintain compatibility with the UNIX family of operating systems. The errno values in a 32-bit Windows operating system are a subset of the values for errno in UNIX systems.

The errno value isn't necessarily the same as the actual error code returned by a system call from the Windows operating system. To access the actual operating system error code, use the _doserrno variable, which contains this value.

The following errno values are supported:

ConstantDescriptionValue
E2BIGArgument list too long.7
EACCESPermission denied. The file's permission setting doesn't allow the specified access. An attempt was made to access a file (or, in some cases, a directory) in a way that's incompatible with the file's attributes.

For example, the error can occur when an attempt is made to read from a file that isn't open. Or, on an attempt to open an existing read-only file for writing, or to open a directory instead of a file. Under MS-DOS operating system versions 3.0 and later, EACCES may also indicate a locking or sharing violation.

The error can also occur in an attempt to rename a file or directory or to remove an existing directory.
13
EAGAINNo more processes or not enough memory or maximum nesting level reached. An attempt to create a new process failed because there are no more process slots, or there isn't enough memory, or the maximum nesting level has been reached.11
EBADFBad file number. There are two possible causes: 1) The specified file descriptor isn't a valid value or doesn't refer to an open file. 2) An attempt was made to write to a file or device opened for read-only access.9
EBUSYDevice or resource busy.16
ECHILDNo spawned processes.10
EDEADLKResource deadlock would occur.36
EDEADLOCKSame as EDEADLK for compatibility with older Microsoft C versions.36
EDOMMath argument. The argument to a math function isn't in the domain of the function.33
EEXISTFiles exists. An attempt has been made to create a file that already exists. For example, the _O_CREAT and _O_EXCL flags are specified in an _open call, but the named file already exists.17
EFAULTBad address.14
EFBIGFile too large.27
EILSEQIllegal sequence of bytes (for example, in an MBCS string).42
EINTRInterrupted function.4
EINVALInvalid argument. An invalid value was given for one of the arguments to a function. For example, the value given for the origin when positioning a file pointer (by a call to fseek) is before the beginning of the file.22
EIOI/O error.5
EISDIRIs a directory.21
EMFILEToo many open files. No more file descriptors are available, so no more files can be opened.24
EMLINKToo many links.31
ENAMETOOLONGFilename too long.38
ENFILEToo many files open in system.23
ENODEVNo such device.19
ENOENTNo such file or directory. The specified file or directory doesn't exist or can't be found. This message can occur whenever a specified file doesn't exist or a component of a path doesn't specify an existing directory.2
ENOEXECExec format error. An attempt was made to execute a file that isn't executable or that has an invalid executable-file format.8
ENOLCKNo locks available.39
ENOMEMNot enough memory is available for the attempted operator. For example, this message can occur when insufficient memory is available to execute a child process, or when the allocation request in a _getcwd call can't be satisfied.12
ENOSPCNo space left on device. No more space for writing is available on the device (for example, when the disk is full).28
ENOSYSFunction not supported.40
ENOTDIRNot a directory.20
ENOTEMPTYDirectory not empty.41
ENOTTYInappropriate I/O control operation.25
ENXIONo such device or address.6
EPERMOperation not permitted.1
EPIPEBroken pipe.32
ERANGEResult too large. An argument to a math function is too large, resulting in partial or total loss of significance in the result. This error can also occur in other functions when an argument is larger than expected (for example, when the buffer argument to _getcwd is longer than expected).34
EROFSRead only file system.30
ESPIPEInvalid seek.29
ESRCHNo such process.3
EXDEVCross-device link. An attempt was made to move a file to a different device (using the rename function).18
STRUNCATEA string copy or concatenation resulted in a truncated string. See _TRUNCATE.80

The following values are supported for compatibility with POSIX:

ConstantDescriptionValue
EADDRINUSEAddress in use.100
EADDRNOTAVAILAddress not available.101
EAFNOSUPPORTAddress family not supported.102
EALREADYConnection already in progress.103
EBADMSGBad message.104
ECANCELEDOperation canceled.105
ECONNABORTEDConnection aborted.106
ECONNREFUSEDConnection refused.107
ECONNRESETConnection reset.108
EDESTADDRREQDestination address required.109
EHOSTUNREACHHost unreachable.110
EIDRMIdentifier removed.111
EINPROGRESSOperation in progress.112
EISCONNAlready connected.113
ELOOPToo many symbolic link levels.114
EMSGSIZEMessage size.115
ENETDOWNNetwork down.116
ENETRESETNetwork reset.117
ENETUNREACHNetwork unreachable.118
ENOBUFSNo buffer space.119
ENODATANo message available.120
ENOLINKNo link.121
ENOMSGNo message.122
ENOPROTOOPTNo protocol option.123
ENOSRNo stream resources.124
ENOSTRNot a stream.125
ENOTCONNNot connected.126
ENOTRECOVERABLEState not recoverable.127
ENOTSOCKNot a socket.128
ENOTSUPNot supported.129
EOPNOTSUPPOperation not supported.130
EOTHEROther.131
EOVERFLOWValue too large.132
EOWNERDEADOwner dead.133
EPROTOProtocol error.134
EPROTONOSUPPORTProtocol not supported.135
EPROTOTYPEWrong protocol type.136
ETIMEStream timeout.137
ETIMEDOUTTimed out.138
ETXTBSYText file busy.139
EWOULDBLOCKOperation would block.140

See also

Global constants

close