cerrno 4.9 KB

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