La definición de estas constantes puede depender del compilador, y se incluyen aquí, sólo como ejemplo.
En el caso de Dev-C++, estas constantes son:
#define EPERM 1 /* Operation not permitted */ #define ENOFILE 2 /* No such file or directory */ #define ENOENT 2 #define ESRCH 3 /* No such process */ #define EINTR 4 /* Interrupted function call */ #define EIO 5 /* Input/output error */ #define ENXIO 6 /* No such device or address */ #define E2BIG 7 /* Arg list too long */ #define ENOEXEC 8 /* Exec format error */ #define EBADF 9 /* Bad file descriptor */ #define ECHILD 10 /* No child processes */ #define EAGAIN 11 /* Resource temporarily unavailable */ #define ENOMEM 12 /* Not enough space */ #define EACCES 13 /* Permission denied */ #define EFAULT 14 /* Bad address */ /* 15 - Unknown Error */ #define EBUSY 16 /* strerror reports "Resource device" */ #define EEXIST 17 /* File exists */ #define EXDEV 18 /* Improper link (cross-device link?) */ #define ENODEV 19 /* No such device */ #define ENOTDIR 20 /* Not a directory */ #define EISDIR 21 /* Is a directory */ #define EINVAL 22 /* Invalid argument */ #define ENFILE 23 /* Too many open files in system */ #define EMFILE 24 /* Too many open files */ #define ENOTTY 25 /* Inappropriate I/O control operation */ /* 26 - Unknown Error */ #define EFBIG 27 /* File too large */ #define ENOSPC 28 /* No space left on device */ #define ESPIPE 29 /* Invalid seek (seek on a pipe?) */ #define EROFS 30 /* Read-only file system */ #define EMLINK 31 /* Too many links */ #define EPIPE 32 /* Broken pipe */ #define EDOM 33 /* Domain error (math functions) */ #define ERANGE 34 /* Result too large (possibly too small) */ /* 35 - Unknown Error */ #define EDEADLOCK 36 /* Resource deadlock avoided (non-Cyg) */ #define EDEADLK 36 /* 37 - Unknown Error */ #define ENAMETOOLONG 38 /* Filename too long (91 in Cyg?) */ #define ENOLCK 39 /* No locks available (46 in Cyg?) */ #define ENOSYS 40 /* Function not implemented (88 in Cyg?) */ #define ENOTEMPTY 41 /* Directory not empty (90 in Cyg?) */ #define EILSEQ 42 /* Illegal byte sequence */
En el caso de Borland C++, son:
#define EZERO 0 /* Error 0 */ #define EINVFNC 1 /* Invalid function number */ #define ENOFILE 2 /* File not found */ #define ENOPATH 3 /* Path not found */ #define ECONTR 7 /* Memory blocks destroyed */ #define EINVMEM 9 /* Invalid memory block address */ #define EINVENV 10 /* Invalid environment */ #define EINVFMT 11 /* Invalid format */ #define EINVACC 12 /* Invalid access code */ #define EINVDAT 13 /* Invalid data */ #define EINVDRV 15 /* Invalid drive specified */ #define ECURDIR 16 /* Attempt to remove CurDir */ #define ENOTSAM 17 /* Not same device */ #define ENMFILE 18 /* No more files */ #define ENOENT 2 /* No such file or directory*/ #define EMFILE 4 /* Too many open files */ #define EACCES 5 /* Permission denied */ #define EBADF 6 /* Bad file number */ #define ENOMEM 8 /* Not enough core */ #define EFAULT 14 /* Unknown error */ #define ENODEV 15 /* No such device */ #define EINVAL 19 /* Invalid argument */ #define E2BIG 20 /* Arg list too long */ #define ENOEXEC 21 /* Exec format error */ #define EXDEV 22 /* Cross-device link */ #define ENFILE 23 /* Too many open files */ #define ECHILD 24 /* No child process */ #define ENOTTY 25 /* UNIX - not MSDOS */ #define ETXTBSY 26 /* UNIX - not MSDOS */ #define EFBIG 27 /* UNIX - not MSDOS */ #define ENOSPC 28 /* No space left on device */ #define ESPIPE 29 /* Illegal seek */ #define EROFS 30 /* Read-only file system */ #define EMLINK 31 /* UNIX - not MSDOS */ #define EPIPE 32 /* Broken pipe */ #define EDOM 33 /* Math argument */ #define ERANGE 34 /* Result too large */ #define EEXIST 35 /* File already exists */ #define EDEADLOCK 36 /* Locking violation */ #define EPERM 37 /* Operation not permitted */ #define ESRCH 38 /* UNIX - not MSDOS */ #define EINTR 39 /* Interrupted function call */ #define EIO 40 /* Input/output error */ #define ENXIO 41 /* No such device or address */ #define EAGAIN 42 /* Resource temporarily unavailable */ #define ENOTBLK 43 /* UNIX - not MSDOS */ #define EBUSY 44 /* Resource busy */ #define ENOTDIR 45 /* UNIX - not MSDOS */ #define EISDIR 46 /* UNIX - not MSDOS */ #define EUCLEAN 47 /* UNIX - not MSDOS */
También se declara la variable:
extern int errno;
Esta variable se usa por la función perror de stdio.h, para obtener los mensajes de error.
© Enero de 2001, Salvador Pozo Coronado, salvador@conclase.net