errno.h 7.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192
  1. /* errno is not a global variable, because that would make using it
  2. non-reentrant. Instead, its address is returned by the function
  3. __errno. */
  4. #ifndef _SYS_ERRNO_H_
  5. #ifdef __cplusplus
  6. extern "C" {
  7. #endif
  8. #define _SYS_ERRNO_H_
  9. #include <sys/reent.h>
  10. #ifndef _REENT_ONLY
  11. #define errno (*__errno())
  12. extern int *__errno (void);
  13. #endif
  14. /* Please don't use these variables directly.
  15. Use strerror instead. */
  16. extern __IMPORT const char * const _sys_errlist[];
  17. extern __IMPORT int _sys_nerr;
  18. #ifdef __CYGWIN__
  19. extern __IMPORT const char * const sys_errlist[];
  20. extern __IMPORT int sys_nerr;
  21. extern __IMPORT char *program_invocation_name;
  22. extern __IMPORT char *program_invocation_short_name;
  23. #endif
  24. #define __errno_r(ptr) ((ptr)->_errno)
  25. #define EPERM 1 /* Not owner */
  26. #define ENOENT 2 /* No such file or directory */
  27. #define ESRCH 3 /* No such process */
  28. #define EINTR 4 /* Interrupted system call */
  29. #define EIO 5 /* I/O error */
  30. #define ENXIO 6 /* No such device or address */
  31. #define E2BIG 7 /* Arg list too long */
  32. #define ENOEXEC 8 /* Exec format error */
  33. #define EBADF 9 /* Bad file number */
  34. #define ECHILD 10 /* No children */
  35. #define EAGAIN 11 /* No more processes */
  36. #define ENOMEM 12 /* Not enough space */
  37. #define EACCES 13 /* Permission denied */
  38. #define EFAULT 14 /* Bad address */
  39. #ifdef __LINUX_ERRNO_EXTENSIONS__
  40. #define ENOTBLK 15 /* Block device required */
  41. #endif
  42. #define EBUSY 16 /* Device or resource busy */
  43. #define EEXIST 17 /* File exists */
  44. #define EXDEV 18 /* Cross-device link */
  45. #define ENODEV 19 /* No such device */
  46. #define ENOTDIR 20 /* Not a directory */
  47. #define EISDIR 21 /* Is a directory */
  48. #define EINVAL 22 /* Invalid argument */
  49. #define ENFILE 23 /* Too many open files in system */
  50. #define EMFILE 24 /* File descriptor value too large */
  51. #define ENOTTY 25 /* Not a character device */
  52. #define ETXTBSY 26 /* Text file busy */
  53. #define EFBIG 27 /* File too large */
  54. #define ENOSPC 28 /* No space left on device */
  55. #define ESPIPE 29 /* Illegal seek */
  56. #define EROFS 30 /* Read-only file system */
  57. #define EMLINK 31 /* Too many links */
  58. #define EPIPE 32 /* Broken pipe */
  59. #define EDOM 33 /* Mathematics argument out of domain of function */
  60. #define ERANGE 34 /* Result too large */
  61. #define ENOMSG 35 /* No message of desired type */
  62. #define EIDRM 36 /* Identifier removed */
  63. #ifdef __LINUX_ERRNO_EXTENSIONS__
  64. #define ECHRNG 37 /* Channel number out of range */
  65. #define EL2NSYNC 38 /* Level 2 not synchronized */
  66. #define EL3HLT 39 /* Level 3 halted */
  67. #define EL3RST 40 /* Level 3 reset */
  68. #define ELNRNG 41 /* Link number out of range */
  69. #define EUNATCH 42 /* Protocol driver not attached */
  70. #define ENOCSI 43 /* No CSI structure available */
  71. #define EL2HLT 44 /* Level 2 halted */
  72. #endif
  73. #define EDEADLK 45 /* Deadlock */
  74. #define ENOLCK 46 /* No lock */
  75. #ifdef __LINUX_ERRNO_EXTENSIONS__
  76. #define EBADE 50 /* Invalid exchange */
  77. #define EBADR 51 /* Invalid request descriptor */
  78. #define EXFULL 52 /* Exchange full */
  79. #define ENOANO 53 /* No anode */
  80. #define EBADRQC 54 /* Invalid request code */
  81. #define EBADSLT 55 /* Invalid slot */
  82. #define EDEADLOCK 56 /* File locking deadlock error */
  83. #define EBFONT 57 /* Bad font file fmt */
  84. #endif
  85. #define ENOSTR 60 /* Not a stream */
  86. #define ENODATA 61 /* No data (for no delay io) */
  87. #define ETIME 62 /* Stream ioctl timeout */
  88. #define ENOSR 63 /* No stream resources */
  89. #ifdef __LINUX_ERRNO_EXTENSIONS__
  90. #define ENONET 64 /* Machine is not on the network */
  91. #define ENOPKG 65 /* Package not installed */
  92. #define EREMOTE 66 /* The object is remote */
  93. #endif
  94. #define ENOLINK 67 /* Virtual circuit is gone */
  95. #ifdef __LINUX_ERRNO_EXTENSIONS__
  96. #define EADV 68 /* Advertise error */
  97. #define ESRMNT 69 /* Srmount error */
  98. #define ECOMM 70 /* Communication error on send */
  99. #endif
  100. #define EPROTO 71 /* Protocol error */
  101. #define EMULTIHOP 74 /* Multihop attempted */
  102. #ifdef __LINUX_ERRNO_EXTENSIONS__
  103. #define ELBIN 75 /* Inode is remote (not really error) */
  104. #define EDOTDOT 76 /* Cross mount point (not really error) */
  105. #endif
  106. #define EBADMSG 77 /* Bad message */
  107. #define EFTYPE 79 /* Inappropriate file type or format */
  108. #ifdef __LINUX_ERRNO_EXTENSIONS__
  109. #define ENOTUNIQ 80 /* Given log. name not unique */
  110. #define EBADFD 81 /* f.d. invalid for this operation */
  111. #define EREMCHG 82 /* Remote address changed */
  112. #define ELIBACC 83 /* Can't access a needed shared lib */
  113. #define ELIBBAD 84 /* Accessing a corrupted shared lib */
  114. #define ELIBSCN 85 /* .lib section in a.out corrupted */
  115. #define ELIBMAX 86 /* Attempting to link in too many libs */
  116. #define ELIBEXEC 87 /* Attempting to exec a shared library */
  117. #endif
  118. #define ENOSYS 88 /* Function not implemented */
  119. #ifdef __CYGWIN__
  120. #define ENMFILE 89 /* No more files */
  121. #endif
  122. #define ENOTEMPTY 90 /* Directory not empty */
  123. #define ENAMETOOLONG 91 /* File or path name too long */
  124. #define ELOOP 92 /* Too many symbolic links */
  125. #define EOPNOTSUPP 95 /* Operation not supported on socket */
  126. #define EPFNOSUPPORT 96 /* Protocol family not supported */
  127. #define ECONNRESET 104 /* Connection reset by peer */
  128. #define ENOBUFS 105 /* No buffer space available */
  129. #define EAFNOSUPPORT 106 /* Address family not supported by protocol family */
  130. #define EPROTOTYPE 107 /* Protocol wrong type for socket */
  131. #define ENOTSOCK 108 /* Socket operation on non-socket */
  132. #define ENOPROTOOPT 109 /* Protocol not available */
  133. #ifdef __LINUX_ERRNO_EXTENSIONS__
  134. #define ESHUTDOWN 110 /* Can't send after socket shutdown */
  135. #endif
  136. #define ECONNREFUSED 111 /* Connection refused */
  137. #define EADDRINUSE 112 /* Address already in use */
  138. #define ECONNABORTED 113 /* Software caused connection abort */
  139. #define ENETUNREACH 114 /* Network is unreachable */
  140. #define ENETDOWN 115 /* Network interface is not configured */
  141. #define ETIMEDOUT 116 /* Connection timed out */
  142. #define EHOSTDOWN 117 /* Host is down */
  143. #define EHOSTUNREACH 118 /* Host is unreachable */
  144. #define EINPROGRESS 119 /* Connection already in progress */
  145. #define EALREADY 120 /* Socket already connected */
  146. #define EDESTADDRREQ 121 /* Destination address required */
  147. #define EMSGSIZE 122 /* Message too long */
  148. #define EPROTONOSUPPORT 123 /* Unknown protocol */
  149. #ifdef __LINUX_ERRNO_EXTENSIONS__
  150. #define ESOCKTNOSUPPORT 124 /* Socket type not supported */
  151. #endif
  152. #define EADDRNOTAVAIL 125 /* Address not available */
  153. #define ENETRESET 126 /* Connection aborted by network */
  154. #define EISCONN 127 /* Socket is already connected */
  155. #define ENOTCONN 128 /* Socket is not connected */
  156. #define ETOOMANYREFS 129
  157. #ifdef __LINUX_ERRNO_EXTENSIONS__
  158. #define EPROCLIM 130
  159. #define EUSERS 131
  160. #endif
  161. #define EDQUOT 132
  162. #define ESTALE 133
  163. #define ENOTSUP 134 /* Not supported */
  164. #ifdef __LINUX_ERRNO_EXTENSIONS__
  165. #define ENOMEDIUM 135 /* No medium (in tape drive) */
  166. #endif
  167. #ifdef __CYGWIN__
  168. #define ENOSHARE 136 /* No such host or network path */
  169. #define ECASECLASH 137 /* Filename exists with different case */
  170. #endif
  171. #define EILSEQ 138 /* Illegal byte sequence */
  172. #define EOVERFLOW 139 /* Value too large for defined data type */
  173. #define ECANCELED 140 /* Operation canceled */
  174. #define ENOTRECOVERABLE 141 /* State not recoverable */
  175. #define EOWNERDEAD 142 /* Previous owner died */
  176. #ifdef __LINUX_ERRNO_EXTENSIONS__
  177. #define ESTRPIPE 143 /* Streams pipe error */
  178. #endif
  179. #define EWOULDBLOCK EAGAIN /* Operation would block */
  180. #define __ELASTERROR 2000 /* Users can add values starting here */
  181. #ifdef __cplusplus
  182. }
  183. #endif
  184. #endif /* _SYS_ERRNO_H */