This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
Download Microsoft Edge
More info about Internet Explorer and Microsoft Edge
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:
Constant
Description
Value
EACCES
Permission 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.
EAGAIN
No 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.
EBADF
Bad 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.
EBUSY
Device or resource busy.
ECHILD
No spawned processes.
EDEADLK
Resource deadlock would occur.
EDEADLOCK
Same as
EDEADLK
for compatibility with older Microsoft C versions.
Math argument. The argument to a math function isn't in the domain of the function.
EEXIST
Files 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.
EFAULT
Bad address.
EFBIG
File too large.
EILSEQ
Illegal sequence of bytes (for example, in an
MBCS
string).
EINTR
Interrupted function.
EINVAL
Invalid 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.
I/O error.
EISDIR
Is a directory.
EMFILE
Too many open files. No more file descriptors are available, so no more files can be opened.
EMLINK
Too many links.
ENAMETOOLONG
Filename too long.
ENFILE
Too many files open in system.
ENODEV
No such device.
ENOENT
No 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.
ENOEXEC
Exec format error. An attempt was made to execute a file that isn't executable or that has an invalid executable-file format.
ENOLCK
No locks available.
ENOMEM
Not 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.
ENOSPC
No space left on device. No more space for writing is available on the device (for example, when the disk is full).
ENOSYS
Function not supported.
ENOTDIR
Not a directory.
ENOTEMPTY
Directory not empty.
ENOTTY
Inappropriate I/O control operation.
ENXIO
No such device or address.
EPERM
Operation not permitted.
EPIPE
Broken pipe.
ERANGE
Result 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).
EROFS
Read only file system.
ESPIPE
Invalid seek.
ESRCH
No such process.
EXDEV
Cross-device link. An attempt was made to move a file to a different device (using the
rename
function).
STRUNCATE
A string copy or concatenation resulted in a truncated string. See
_TRUNCATE
.
The following values are supported for compatibility with POSIX:
Constant
Description
Value