Discusión:Errno.h

Último comentario: hace 15 años por Dagilpe en el tema No Listas, ¿artículo?

No Listas, ¿artículo? editar

Exactamente lo que dice el nombre. Dagilpe (Escríbeme aquí) 15:45 27 jul 2008 (UTC)Responder


Librería errno ANSI C editar

Esta es una traduccion del articulo en ingles de wikipedia y agrego la definiciones de errno ANSI C errno.h es un archivo de cabecera en la librería estándar del lenguaje de programación C. En ella se definen las macros que presentan un informe de error a través de códigos de error.

La macro errno se expande a un lvalue con tipo int, que contiene el último código de error generado en cualquiera de las funciones utilizando la instalación de errno.

Tres macros para ampliar entero constantes que representan los códigos de error:

    * Edom resultados de un parámetro fuera de una función de dominio, por ejemplo, sqrt (-1)
    * ERANGE el resultado de un resultado fuera de una función de la gama, por ejemplo strtol ( "0xfffffffff", NULL, 0)
    * EILSEQ resultados de una secuencia de carácter ilegal, por ejemplo wcstombs (str, L "\ xffff", 2)

Sistemas operativos compatibles con POSIX como UNIX o Linux podrán incluir otras macros para representar a otros números de código de error del sistema operativo.

El 19 de diciembre de 2003 el grupo de SCO publicó avisos de DMCA a las compañías seleccionadas de la Fortune 1000, alegando el archivo de errno.h fue copiado de UNIX en Linux sin la autorización. Linus Torvalds, el creador y sostenedor de la marca registrada de Linux, ha negado la demanda de SCO, diciendo que él mismo escribió el código para la versión de Linux. Vea los códigos de error en Linux para los códigos de error de estándar en Linux.

Definiciones de errno ANSI C

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:

  1. define EPERM 1 /* Operation not permitted */
  2. define ENOFILE 2 /* No such file or directory */
  3. define ENOENT 2
  4. define ESRCH 3 /* No such proces*s */
  5. define EINTR* 4 /* Interrupted function call* */
  6. define EIO 5 /* Input/output error */
  7. define ENXIO 6 /* No such device or address */
  8. define E2BIG 7 /* Arg list too long */
  9. define ENOEXEC 8 /* Exec format error */
  10. define EBADF 9 /* Bad file descriptor */
  11. define ECHILD 10 /* No child processes */
  12. define EAGAIN 11 /* Resource temporarily unavailable */
  13. define ENOMEM 12 /* Not enough space */
  14. define EACCES 13 /* Permission denied */
  15. define EFAULT 14 /* Bad address */
                /* 15 - Unknown Error */
  1. define EBUSY 16 /* strerror reports "Resource device" */
  2. define EEXIST 17 /* File exists */
  3. define EXDEV 18 /* Improper link (cross-device link?) */
  4. define ENODEV 19 /* No such device */
  5. define ENOTDIR 20 /* Not a directory */
  6. define EISDIR 21 /* Is a directory */
  7. define EINVAL 22 /* Invalid argument */
  8. define ENFILE 23 /* Too many open files in system */
  9. define EMFILE 24 /* Too many open files */
  10. define ENOTTY 25 /* Inappropriate I/O control operation */

/* 26 - Unknown Error */

  1. define EFBIG 27 /* File too large */
  2. define ENOSPC 28 /* No space left on device */
  3. define ESPIPE 29 /* Invalid seek (seek on a pipe?) */
  4. define EROFS 30 /* Read-only file system */
  5. define EMLINK 31 /* Too many links */
  6. define EPIPE 32 /* Broken pipe */
  7. define EDOM 33 /* Domain error (math functions) */
  8. define ERANGE 34 /* Result too large (possibly too small) */

/* 35 - Unknown Error */

  1. define EDEADLOCK 36 /* Resource deadlock avoided (non-Cyg) */
  2. define EDEADLK 36

/* 37 - Unknown Error */

  1. define ENAMETOOLONG 38 /* Filename too long (91 in Cyg?) */
  2. define ENOLCK 39 /* No locks available (46 in Cyg?) */
  3. define ENOSYS 40 /* Function not implemented (88 in Cyg?) */
  4. define ENOTEMPTY 41 /* Directory not empty (90 in Cyg?) */
  5. define EILSEQ 42 /* Illegal byte sequence */

En el caso de Borland C++, son:

  1. define EZERO 0 /* Error 0 */
  2. define EINVFNC 1 /* Invalid function number */
  3. define ENOFILE 2 /* File not found */
  4. define ENOPATH 3 /* Path not found */
  5. define ECONTR 7 /* Memory blocks destroyed */
  6. define EINVMEM 9 /* Invalid memory block address */
  7. define EINVENV 10 /* Invalid environment */
  8. define EINVFMT 11 /* Invalid format */
  9. define EINVACC 12 /* Invalid access code */
  10. define EINVDAT 13 /* Invalid data */
  11. define EINVDRV 15 /* Invalid drive specified */
  12. define ECURDIR 16 /* Attempt to remove CurDir */
  13. define ENOTSAM 17 /* Not same device */
  14. define ENMFILE 18 /* No more files */
  1. define ENOENT 2 /* No such file or directory*/
  2. define EMFILE 4 /* Too many open files */
  3. define EACCES 5 /* Permission denied */
  4. define EBADF 6 /* Bad file number */
  5. define ENOMEM 8 /* Not enough core */
  6. define EFAULT 14 /* Unknown error */
  7. define ENODEV 15 /* No such device */
  8. define EINVAL 19 /* Invalid argument */
  9. define E2BIG 20 /* Arg list too long */
  10. define ENOEXEC 21 /* Exec format error */
  11. define EXDEV 22 /* Cross-device link */
  12. define ENFILE 23 /* Too many open files */
  13. define ECHILD 24 /* No child process */
  14. define ENOTTY 25 /* UNIX - not MSDOS */
  15. define ETXTBSY 26 /* UNIX - not MSDOS */
  16. define EFBIG 27 /* UNIX - not MSDOS */
  17. define ENOSPC 28 /* No space left on device */
  18. define ESPIPE 29 /* Illegal seek */
  19. define EROFS 30 /* Read-only file system */
  20. define EMLINK 31 /* UNIX - not MSDOS */
  21. define EPIPE 32 /* Broken pipe */
  22. define EDOM 33 /* Math argument */
  23. define ERANGE 34 /* Result too large */
  24. define EEXIST 35 /* File already exists */
  25. define EDEADLOCK 36 /* Locking violation */
  26. define EPERM 37 /* Operation not permitted */
  27. define ESRCH 38 /* UNIX - not MSDOS */
  28. define EINTR 39 /* Interrupted function call */
  29. define EIO 40 /* Input/output error */
  30. define ENXIO 41 /* No such device or address */
  31. define EAGAIN 42 /* Resource temporarily unavailable */
  32. define ENOTBLK 43 /* UNIX - not MSDOS */
  33. define EBUSY 44 /* Resource busy */
  34. define ENOTDIR 45 /* UNIX - not MSDOS */
  35. define EISDIR 46 /* UNIX - not MSDOS */
  36. 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.

ENLACES EXTERNOS

Wikipwdia en ingles [[1]]

Dev-c++ editar

Dev-c++ no es un compilador, solo es un ide, el compilador que usa es MinGw, que es la vercion de gcc para windows

Volver a la página «Errno.h».