errno.in.h 7.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280
  1. /* A POSIX-like <errno.h>.
  2. Copyright (C) 2008-2023 Free Software Foundation, Inc.
  3. This file is free software: you can redistribute it and/or modify
  4. it under the terms of the GNU Lesser General Public License as
  5. published by the Free Software Foundation; either version 2.1 of the
  6. License, or (at your option) any later version.
  7. This file is distributed in the hope that it will be useful,
  8. but WITHOUT ANY WARRANTY; without even the implied warranty of
  9. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  10. GNU Lesser General Public License for more details.
  11. You should have received a copy of the GNU Lesser General Public License
  12. along with this program. If not, see <https://www.gnu.org/licenses/>. */
  13. #ifndef _@GUARD_PREFIX@_ERRNO_H
  14. #if __GNUC__ >= 3
  15. @PRAGMA_SYSTEM_HEADER@
  16. #endif
  17. @PRAGMA_COLUMNS@
  18. /* The include_next requires a split double-inclusion guard. */
  19. #@INCLUDE_NEXT@ @NEXT_ERRNO_H@
  20. #ifndef _@GUARD_PREFIX@_ERRNO_H
  21. #define _@GUARD_PREFIX@_ERRNO_H
  22. /* On native Windows platforms, many macros are not defined. */
  23. # if defined _WIN32 && ! defined __CYGWIN__
  24. /* These are the same values as defined by MSVC 10, for interoperability. */
  25. # ifndef ENOMSG
  26. # define ENOMSG 122
  27. # define GNULIB_defined_ENOMSG 1
  28. # endif
  29. # ifndef EIDRM
  30. # define EIDRM 111
  31. # define GNULIB_defined_EIDRM 1
  32. # endif
  33. # ifndef ENOLINK
  34. # define ENOLINK 121
  35. # define GNULIB_defined_ENOLINK 1
  36. # endif
  37. # ifndef EPROTO
  38. # define EPROTO 134
  39. # define GNULIB_defined_EPROTO 1
  40. # endif
  41. # ifndef EBADMSG
  42. # define EBADMSG 104
  43. # define GNULIB_defined_EBADMSG 1
  44. # endif
  45. # ifndef EOVERFLOW
  46. # define EOVERFLOW 132
  47. # define GNULIB_defined_EOVERFLOW 1
  48. # endif
  49. # ifndef ENOTSUP
  50. # define ENOTSUP 129
  51. # define GNULIB_defined_ENOTSUP 1
  52. # endif
  53. # ifndef ENETRESET
  54. # define ENETRESET 117
  55. # define GNULIB_defined_ENETRESET 1
  56. # endif
  57. # ifndef ECONNABORTED
  58. # define ECONNABORTED 106
  59. # define GNULIB_defined_ECONNABORTED 1
  60. # endif
  61. # ifndef ECANCELED
  62. # define ECANCELED 105
  63. # define GNULIB_defined_ECANCELED 1
  64. # endif
  65. # ifndef EOWNERDEAD
  66. # define EOWNERDEAD 133
  67. # define GNULIB_defined_EOWNERDEAD 1
  68. # endif
  69. # ifndef ENOTRECOVERABLE
  70. # define ENOTRECOVERABLE 127
  71. # define GNULIB_defined_ENOTRECOVERABLE 1
  72. # endif
  73. # ifndef EINPROGRESS
  74. # define EINPROGRESS 112
  75. # define EALREADY 103
  76. # define ENOTSOCK 128
  77. # define EDESTADDRREQ 109
  78. # define EMSGSIZE 115
  79. # define EPROTOTYPE 136
  80. # define ENOPROTOOPT 123
  81. # define EPROTONOSUPPORT 135
  82. # define EOPNOTSUPP 130
  83. # define EAFNOSUPPORT 102
  84. # define EADDRINUSE 100
  85. # define EADDRNOTAVAIL 101
  86. # define ENETDOWN 116
  87. # define ENETUNREACH 118
  88. # define ECONNRESET 108
  89. # define ENOBUFS 119
  90. # define EISCONN 113
  91. # define ENOTCONN 126
  92. # define ETIMEDOUT 138
  93. # define ECONNREFUSED 107
  94. # define ELOOP 114
  95. # define EHOSTUNREACH 110
  96. # define EWOULDBLOCK 140
  97. # define GNULIB_defined_ESOCK 1
  98. # endif
  99. # ifndef ETXTBSY
  100. # define ETXTBSY 139
  101. # define ENODATA 120 /* not required by POSIX */
  102. # define ENOSR 124 /* not required by POSIX */
  103. # define ENOSTR 125 /* not required by POSIX */
  104. # define ETIME 137 /* not required by POSIX */
  105. # define EOTHER 131 /* not required by POSIX */
  106. # define GNULIB_defined_ESTREAMS 1
  107. # endif
  108. /* These are intentionally the same values as the WSA* error numbers, defined
  109. in <winsock2.h>. */
  110. # define ESOCKTNOSUPPORT 10044 /* not required by POSIX */
  111. # define EPFNOSUPPORT 10046 /* not required by POSIX */
  112. # define ESHUTDOWN 10058 /* not required by POSIX */
  113. # define ETOOMANYREFS 10059 /* not required by POSIX */
  114. # define EHOSTDOWN 10064 /* not required by POSIX */
  115. # define EPROCLIM 10067 /* not required by POSIX */
  116. # define EUSERS 10068 /* not required by POSIX */
  117. # define EDQUOT 10069
  118. # define ESTALE 10070
  119. # define EREMOTE 10071 /* not required by POSIX */
  120. # define GNULIB_defined_EWINSOCK 1
  121. # endif
  122. /* On OSF/1 5.1, when _XOPEN_SOURCE_EXTENDED is not defined, the macros
  123. EMULTIHOP, ENOLINK, EOVERFLOW are not defined. */
  124. # if @EMULTIHOP_HIDDEN@
  125. # define EMULTIHOP @EMULTIHOP_VALUE@
  126. # define GNULIB_defined_EMULTIHOP 1
  127. # endif
  128. # if @ENOLINK_HIDDEN@
  129. # define ENOLINK @ENOLINK_VALUE@
  130. # define GNULIB_defined_ENOLINK 1
  131. # endif
  132. # if @EOVERFLOW_HIDDEN@
  133. # define EOVERFLOW @EOVERFLOW_VALUE@
  134. # define GNULIB_defined_EOVERFLOW 1
  135. # endif
  136. /* On OpenBSD 4.0 and on native Windows, the macros ENOMSG, EIDRM, ENOLINK,
  137. EPROTO, EMULTIHOP, EBADMSG, EOVERFLOW, ENOTSUP, ECANCELED are not defined.
  138. Likewise, on NonStop Kernel, EDQUOT is not defined.
  139. Define them here. Values >= 2000 seem safe to use: Solaris ESTALE = 151,
  140. HP-UX EWOULDBLOCK = 246, IRIX EDQUOT = 1133.
  141. Note: When one of these systems defines some of these macros some day,
  142. binaries will have to be recompiled so that they recognizes the new
  143. errno values from the system. */
  144. # ifndef ENOMSG
  145. # define ENOMSG 2000
  146. # define GNULIB_defined_ENOMSG 1
  147. # endif
  148. # ifndef EIDRM
  149. # define EIDRM 2001
  150. # define GNULIB_defined_EIDRM 1
  151. # endif
  152. # ifndef ENOLINK
  153. # define ENOLINK 2002
  154. # define GNULIB_defined_ENOLINK 1
  155. # endif
  156. # ifndef EPROTO
  157. # define EPROTO 2003
  158. # define GNULIB_defined_EPROTO 1
  159. # endif
  160. # ifndef EMULTIHOP
  161. # define EMULTIHOP 2004
  162. # define GNULIB_defined_EMULTIHOP 1
  163. # endif
  164. # ifndef EBADMSG
  165. # define EBADMSG 2005
  166. # define GNULIB_defined_EBADMSG 1
  167. # endif
  168. # ifndef EOVERFLOW
  169. # define EOVERFLOW 2006
  170. # define GNULIB_defined_EOVERFLOW 1
  171. # endif
  172. # ifndef ENOTSUP
  173. # define ENOTSUP 2007
  174. # define GNULIB_defined_ENOTSUP 1
  175. # endif
  176. # ifndef ENETRESET
  177. # define ENETRESET 2011
  178. # define GNULIB_defined_ENETRESET 1
  179. # endif
  180. # ifndef ECONNABORTED
  181. # define ECONNABORTED 2012
  182. # define GNULIB_defined_ECONNABORTED 1
  183. # endif
  184. # ifndef ESTALE
  185. # define ESTALE 2009
  186. # define GNULIB_defined_ESTALE 1
  187. # endif
  188. # ifndef EDQUOT
  189. # define EDQUOT 2010
  190. # define GNULIB_defined_EDQUOT 1
  191. # endif
  192. # ifndef ECANCELED
  193. # define ECANCELED 2008
  194. # define GNULIB_defined_ECANCELED 1
  195. # endif
  196. /* On many platforms, the macros EOWNERDEAD and ENOTRECOVERABLE are not
  197. defined. */
  198. # ifndef EOWNERDEAD
  199. # if defined __sun
  200. /* Use the same values as defined for Solaris >= 8, for
  201. interoperability. */
  202. # define EOWNERDEAD 58
  203. # define ENOTRECOVERABLE 59
  204. # elif defined _WIN32 && ! defined __CYGWIN__
  205. /* We have a conflict here: pthreads-win32 defines these values
  206. differently than MSVC 10. It's hairy to decide which one to use. */
  207. # if defined __MINGW32__ && !defined USE_WINDOWS_THREADS
  208. /* Use the same values as defined by pthreads-win32, for
  209. interoperability. */
  210. # define EOWNERDEAD 43
  211. # define ENOTRECOVERABLE 44
  212. # else
  213. /* Use the same values as defined by MSVC 10, for
  214. interoperability. */
  215. # define EOWNERDEAD 133
  216. # define ENOTRECOVERABLE 127
  217. # endif
  218. # else
  219. # define EOWNERDEAD 2013
  220. # define ENOTRECOVERABLE 2014
  221. # endif
  222. # define GNULIB_defined_EOWNERDEAD 1
  223. # define GNULIB_defined_ENOTRECOVERABLE 1
  224. # endif
  225. # ifndef EILSEQ
  226. # define EILSEQ 2015
  227. # define GNULIB_defined_EILSEQ 1
  228. # endif
  229. #endif /* _@GUARD_PREFIX@_ERRNO_H */
  230. #endif /* _@GUARD_PREFIX@_ERRNO_H */