errno.h 5.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399
  1. // -*- C++ -*-
  2. //===----------------------------------------------------------------------===//
  3. //
  4. // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
  5. // See https://llvm.org/LICENSE.txt for license information.
  6. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
  7. //
  8. //===----------------------------------------------------------------------===//
  9. #ifndef _LIBCPP_ERRNO_H
  10. #define _LIBCPP_ERRNO_H
  11. /*
  12. errno.h synopsis
  13. Macros:
  14. EDOM
  15. EILSEQ // C99
  16. ERANGE
  17. errno
  18. */
  19. #include <__config>
  20. #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
  21. # pragma GCC system_header
  22. #endif
  23. #if __has_include_next(<errno.h>)
  24. # include_next <errno.h>
  25. #endif
  26. #ifdef __cplusplus
  27. #if !defined(EOWNERDEAD) || !defined(ENOTRECOVERABLE)
  28. #ifdef ELAST
  29. static const int __elast1 = ELAST+1;
  30. static const int __elast2 = ELAST+2;
  31. #else
  32. static const int __elast1 = 104;
  33. static const int __elast2 = 105;
  34. #endif
  35. #ifdef ENOTRECOVERABLE
  36. #define EOWNERDEAD __elast1
  37. #ifdef ELAST
  38. #undef ELAST
  39. #define ELAST EOWNERDEAD
  40. #endif
  41. #elif defined(EOWNERDEAD)
  42. #define ENOTRECOVERABLE __elast1
  43. #ifdef ELAST
  44. #undef ELAST
  45. #define ELAST ENOTRECOVERABLE
  46. #endif
  47. #else // defined(EOWNERDEAD)
  48. #define EOWNERDEAD __elast1
  49. #define ENOTRECOVERABLE __elast2
  50. #ifdef ELAST
  51. #undef ELAST
  52. #define ELAST ENOTRECOVERABLE
  53. #endif
  54. #endif // defined(EOWNERDEAD)
  55. #endif // !defined(EOWNERDEAD) || !defined(ENOTRECOVERABLE)
  56. // supply errno values likely to be missing, particularly on Windows
  57. #ifndef EAFNOSUPPORT
  58. #define EAFNOSUPPORT 9901
  59. #endif
  60. #ifndef EADDRINUSE
  61. #define EADDRINUSE 9902
  62. #endif
  63. #ifndef EADDRNOTAVAIL
  64. #define EADDRNOTAVAIL 9903
  65. #endif
  66. #ifndef EISCONN
  67. #define EISCONN 9904
  68. #endif
  69. #ifndef EBADMSG
  70. #define EBADMSG 9905
  71. #endif
  72. #ifndef ECONNABORTED
  73. #define ECONNABORTED 9906
  74. #endif
  75. #ifndef EALREADY
  76. #define EALREADY 9907
  77. #endif
  78. #ifndef ECONNREFUSED
  79. #define ECONNREFUSED 9908
  80. #endif
  81. #ifndef ECONNRESET
  82. #define ECONNRESET 9909
  83. #endif
  84. #ifndef EDESTADDRREQ
  85. #define EDESTADDRREQ 9910
  86. #endif
  87. #ifndef EHOSTUNREACH
  88. #define EHOSTUNREACH 9911
  89. #endif
  90. #ifndef EIDRM
  91. #define EIDRM 9912
  92. #endif
  93. #ifndef EMSGSIZE
  94. #define EMSGSIZE 9913
  95. #endif
  96. #ifndef ENETDOWN
  97. #define ENETDOWN 9914
  98. #endif
  99. #ifndef ENETRESET
  100. #define ENETRESET 9915
  101. #endif
  102. #ifndef ENETUNREACH
  103. #define ENETUNREACH 9916
  104. #endif
  105. #ifndef ENOBUFS
  106. #define ENOBUFS 9917
  107. #endif
  108. #ifndef ENOLINK
  109. #define ENOLINK 9918
  110. #endif
  111. #ifndef ENODATA
  112. #define ENODATA 9919
  113. #endif
  114. #ifndef ENOMSG
  115. #define ENOMSG 9920
  116. #endif
  117. #ifndef ENOPROTOOPT
  118. #define ENOPROTOOPT 9921
  119. #endif
  120. #ifndef ENOSR
  121. #define ENOSR 9922
  122. #endif
  123. #ifndef ENOTSOCK
  124. #define ENOTSOCK 9923
  125. #endif
  126. #ifndef ENOSTR
  127. #define ENOSTR 9924
  128. #endif
  129. #ifndef ENOTCONN
  130. #define ENOTCONN 9925
  131. #endif
  132. #ifndef ENOTSUP
  133. #define ENOTSUP 9926
  134. #endif
  135. #ifndef ECANCELED
  136. #define ECANCELED 9927
  137. #endif
  138. #ifndef EINPROGRESS
  139. #define EINPROGRESS 9928
  140. #endif
  141. #ifndef EOPNOTSUPP
  142. #define EOPNOTSUPP 9929
  143. #endif
  144. #ifndef EWOULDBLOCK
  145. #define EWOULDBLOCK 9930
  146. #endif
  147. #ifndef EOWNERDEAD
  148. #define EOWNERDEAD 9931
  149. #endif
  150. #ifndef EPROTO
  151. #define EPROTO 9932
  152. #endif
  153. #ifndef EPROTONOSUPPORT
  154. #define EPROTONOSUPPORT 9933
  155. #endif
  156. #ifndef ENOTRECOVERABLE
  157. #define ENOTRECOVERABLE 9934
  158. #endif
  159. #ifndef ETIME
  160. #define ETIME 9935
  161. #endif
  162. #ifndef ETXTBSY
  163. #define ETXTBSY 9936
  164. #endif
  165. #ifndef ETIMEDOUT
  166. #define ETIMEDOUT 9938
  167. #endif
  168. #ifndef ELOOP
  169. #define ELOOP 9939
  170. #endif
  171. #ifndef EOVERFLOW
  172. #define EOVERFLOW 9940
  173. #endif
  174. #ifndef EPROTOTYPE
  175. #define EPROTOTYPE 9941
  176. #endif
  177. #ifndef ENOSYS
  178. #define ENOSYS 9942
  179. #endif
  180. #ifndef EINVAL
  181. #define EINVAL 9943
  182. #endif
  183. #ifndef ERANGE
  184. #define ERANGE 9944
  185. #endif
  186. #ifndef EILSEQ
  187. #define EILSEQ 9945
  188. #endif
  189. // Windows Mobile doesn't appear to define these:
  190. #ifndef E2BIG
  191. #define E2BIG 9946
  192. #endif
  193. #ifndef EDOM
  194. #define EDOM 9947
  195. #endif
  196. #ifndef EFAULT
  197. #define EFAULT 9948
  198. #endif
  199. #ifndef EBADF
  200. #define EBADF 9949
  201. #endif
  202. #ifndef EPIPE
  203. #define EPIPE 9950
  204. #endif
  205. #ifndef EXDEV
  206. #define EXDEV 9951
  207. #endif
  208. #ifndef EBUSY
  209. #define EBUSY 9952
  210. #endif
  211. #ifndef ENOTEMPTY
  212. #define ENOTEMPTY 9953
  213. #endif
  214. #ifndef ENOEXEC
  215. #define ENOEXEC 9954
  216. #endif
  217. #ifndef EEXIST
  218. #define EEXIST 9955
  219. #endif
  220. #ifndef EFBIG
  221. #define EFBIG 9956
  222. #endif
  223. #ifndef ENAMETOOLONG
  224. #define ENAMETOOLONG 9957
  225. #endif
  226. #ifndef ENOTTY
  227. #define ENOTTY 9958
  228. #endif
  229. #ifndef EINTR
  230. #define EINTR 9959
  231. #endif
  232. #ifndef ESPIPE
  233. #define ESPIPE 9960
  234. #endif
  235. #ifndef EIO
  236. #define EIO 9961
  237. #endif
  238. #ifndef EISDIR
  239. #define EISDIR 9962
  240. #endif
  241. #ifndef ECHILD
  242. #define ECHILD 9963
  243. #endif
  244. #ifndef ENOLCK
  245. #define ENOLCK 9964
  246. #endif
  247. #ifndef ENOSPC
  248. #define ENOSPC 9965
  249. #endif
  250. #ifndef ENXIO
  251. #define ENXIO 9966
  252. #endif
  253. #ifndef ENODEV
  254. #define ENODEV 9967
  255. #endif
  256. #ifndef ENOENT
  257. #define ENOENT 9968
  258. #endif
  259. #ifndef ESRCH
  260. #define ESRCH 9969
  261. #endif
  262. #ifndef ENOTDIR
  263. #define ENOTDIR 9970
  264. #endif
  265. #ifndef ENOMEM
  266. #define ENOMEM 9971
  267. #endif
  268. #ifndef EPERM
  269. #define EPERM 9972
  270. #endif
  271. #ifndef EACCES
  272. #define EACCES 9973
  273. #endif
  274. #ifndef EROFS
  275. #define EROFS 9974
  276. #endif
  277. #ifndef EDEADLK
  278. #define EDEADLK 9975
  279. #endif
  280. #ifndef EAGAIN
  281. #define EAGAIN 9976
  282. #endif
  283. #ifndef ENFILE
  284. #define ENFILE 9977
  285. #endif
  286. #ifndef EMFILE
  287. #define EMFILE 9978
  288. #endif
  289. #ifndef EMLINK
  290. #define EMLINK 9979
  291. #endif
  292. #endif // __cplusplus
  293. #endif // _LIBCPP_ERRNO_H