INF: Some errno Values Do Not Apply to MS-DOS

ID Number: Q47692

5.00 5.10 6.00 6.00a 6.00ax 7.00

MS-DOS

Summary:

In Microsoft C versions 5.0, 5.1, 6.0, 6.0a, 6.0ax, and C/C++ version

7.0, when an error occurs in some library routines, the errno variable

is set to a value that can be used to indicate the nature of the error.

These error codes are defined in the file ERRNO.H. The codes originally

were set up for use with UNIX to conform to errors occurring under that

operating system. Because of this, and the differences between MS-DOS

and UNIX, many of the codes have no relevance to the MS-DOS

environment.

To maintain compatibility with UNIX and XENIX, all the codes, whether

meaningful in MS-DOS or not, are defined in ERRNO.H. Appendix A of the

"Microsoft C Optimizing Compiler Run-Time Library Reference" version

5.1 manual lists only those codes that are meaningful to MS-DOS along

with their description and causes. These specific codes have

corresponding error messages that can be printed out with the perror()

function.

If you are working with MS-DOS and you obtain an errno value that is

not one of the listed codes, you can assume that the error code was

generated incorrectly and is not indicative of the true problem. The

documentation for the specific function you are using says which errno

values, if any, may be set by an error in that function.

More Information:

The following is a listing of all the errno values defined in ERRNO.H

along with brief descriptions of their meanings. Only the values

marked with an asterisk (*) are considered valid under MS-DOS. For

more information on these values, see Appendix A of the "Microsoft C

Optimizing Compiler Run-Time Library Reference" version 5.1 manual.

For more information on the values that are not marked with an

asterisk, see a UNIX or XENIX system manual.

Value Define Description

----- ------ -----------

EPERM 1 Not owner

ENOENT 2 *No such file or directory

ESRCH 3 No such process

EINTR 4 Interrupted system call

EIO 5 I/O error

ENXIO 6 No such device or address

E2BIG 7 *Arg list too long

ENOEXEC 8 *Exec format error

EBADF 9 *Bad file number

ECHILD 10 No child processes

EAGAIN 11 No more processes

ENOMEM 12 *Not enough space

EACCES 13 *Permission denied

EFAULT 14 Bad address

ENOTBLK 15 Block device required

EBUSY 16 Mount device busy

EEXIST 17 *File exists

EXDEV 18 *Cross-device link

ENODEV 19 No such device

ENOTDIR 20 Not a directory

EISDIR 21 Is a directory

EINVAL 22 *Invalid argument

ENFILE 23 File table overflow

EMFILE 24 *Too many open files

ENOTTY 25 Not a teletype

ETXTBSY 26 Text file busy

EFBIG 27 File too large

ENOSPC 28 *No space left on device

ESPIPE 29 Illegal seek

EROFS 30 Read-only file system

EMLINK 31 Too many links

EPIPE 32 Broken pipe

EDOM 33 *Math argument

ERANGE 34 *Result too large

EUCLEAN 35 File system needs cleaning

EDEADLOCK 36 *Would deadlock

* Used under MS-DOS

Additional reference words: 5.00 5.10 6.00 6.00a 6.00ax 7.00