errno.h 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117
  1. /*
  2. * errno.h
  3. *
  4. * Error numbers and access to error reporting.
  5. *
  6. * This file is part of the Mingw32 package.
  7. *
  8. * Contributors:
  9. * Created by Colin Peters <[email protected]>
  10. *
  11. * THIS SOFTWARE IS NOT COPYRIGHTED
  12. *
  13. * This source code is offered for use in the public domain. You may
  14. * use, modify or distribute it freely.
  15. *
  16. * This code is distributed in the hope that it will be useful but
  17. * WITHOUT ANY WARRANTY. ALL WARRANTIES, EXPRESS OR IMPLIED ARE HEREBY
  18. * DISCLAIMED. This includes but is not limited to warranties of
  19. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  20. *
  21. * $Revision: 1.2 $
  22. * $Author: bellard $
  23. * $Date: 2005/04/17 13:14:29 $
  24. *
  25. */
  26. #ifndef _ERRNO_H_
  27. #define _ERRNO_H_
  28. /* All the headers include this file. */
  29. #include <_mingw.h>
  30. /*
  31. * Error numbers.
  32. * TODO: Can't be sure of some of these assignments, I guessed from the
  33. * names given by strerror and the defines in the Cygnus errno.h. A lot
  34. * of the names from the Cygnus errno.h are not represented, and a few
  35. * of the descriptions returned by strerror do not obviously match
  36. * their error naming.
  37. */
  38. #define EPERM 1 /* Operation not permitted */
  39. #define ENOFILE 2 /* No such file or directory */
  40. #define ENOENT 2
  41. #define ESRCH 3 /* No such process */
  42. #define EINTR 4 /* Interrupted function call */
  43. #define EIO 5 /* Input/output error */
  44. #define ENXIO 6 /* No such device or address */
  45. #define E2BIG 7 /* Arg list too long */
  46. #define ENOEXEC 8 /* Exec format error */
  47. #define EBADF 9 /* Bad file descriptor */
  48. #define ECHILD 10 /* No child processes */
  49. #define EAGAIN 11 /* Resource temporarily unavailable */
  50. #define ENOMEM 12 /* Not enough space */
  51. #define EACCES 13 /* Permission denied */
  52. #define EFAULT 14 /* Bad address */
  53. /* 15 - Unknown Error */
  54. #define EBUSY 16 /* strerror reports "Resource device" */
  55. #define EEXIST 17 /* File exists */
  56. #define EXDEV 18 /* Improper link (cross-device link?) */
  57. #define ENODEV 19 /* No such device */
  58. #define ENOTDIR 20 /* Not a directory */
  59. #define EISDIR 21 /* Is a directory */
  60. #define EINVAL 22 /* Invalid argument */
  61. #define ENFILE 23 /* Too many open files in system */
  62. #define EMFILE 24 /* Too many open files */
  63. #define ENOTTY 25 /* Inappropriate I/O control operation */
  64. /* 26 - Unknown Error */
  65. #define EFBIG 27 /* File too large */
  66. #define ENOSPC 28 /* No space left on device */
  67. #define ESPIPE 29 /* Invalid seek (seek on a pipe?) */
  68. #define EROFS 30 /* Read-only file system */
  69. #define EMLINK 31 /* Too many links */
  70. #define EPIPE 32 /* Broken pipe */
  71. #define EDOM 33 /* Domain error (math functions) */
  72. #define ERANGE 34 /* Result too large (possibly too small) */
  73. /* 35 - Unknown Error */
  74. #define EDEADLOCK 36 /* Resource deadlock avoided (non-Cyg) */
  75. #define EDEADLK 36
  76. /* 37 - Unknown Error */
  77. #define ENAMETOOLONG 38 /* Filename too long (91 in Cyg?) */
  78. #define ENOLCK 39 /* No locks available (46 in Cyg?) */
  79. #define ENOSYS 40 /* Function not implemented (88 in Cyg?) */
  80. #define ENOTEMPTY 41 /* Directory not empty (90 in Cyg?) */
  81. #define EILSEQ 42 /* Illegal byte sequence */
  82. /*
  83. * NOTE: ENAMETOOLONG and ENOTEMPTY conflict with definitions in the
  84. * sockets.h header provided with windows32api-0.1.2.
  85. * You should go and put an #if 0 ... #endif around the whole block
  86. * of errors (look at the comment above them).
  87. */
  88. #ifndef RC_INVOKED
  89. #ifdef __cplusplus
  90. extern "C" {
  91. #endif
  92. /*
  93. * Definitions of errno. For _doserrno, sys_nerr and * sys_errlist, see
  94. * stdlib.h.
  95. */
  96. #ifdef _UWIN
  97. #undef errno
  98. extern int errno;
  99. #else
  100. int* _errno(void);
  101. #define errno (*_errno())
  102. #endif
  103. #ifdef __cplusplus
  104. }
  105. #endif
  106. #endif /* Not RC_INVOKED */
  107. #endif /* Not _ERRNO_H_ */