1
0

uv-errno.h 8.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373
  1. /* Copyright Joyent, Inc. and other Node contributors. All rights reserved.
  2. *
  3. * Permission is hereby granted, free of charge, to any person obtaining a copy
  4. * of this software and associated documentation files (the "Software"), to
  5. * deal in the Software without restriction, including without limitation the
  6. * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
  7. * sell copies of the Software, and to permit persons to whom the Software is
  8. * furnished to do so, subject to the following conditions:
  9. *
  10. * The above copyright notice and this permission notice shall be included in
  11. * all copies or substantial portions of the Software.
  12. *
  13. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  14. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  15. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  16. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  17. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
  18. * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
  19. * IN THE SOFTWARE.
  20. */
  21. #ifndef UV_ERRNO_H_
  22. #define UV_ERRNO_H_
  23. #include <errno.h>
  24. #define UV__EOF (-4095)
  25. #define UV__UNKNOWN (-4094)
  26. #define UV__EAI_ADDRFAMILY (-3000)
  27. #define UV__EAI_AGAIN (-3001)
  28. #define UV__EAI_BADFLAGS (-3002)
  29. #define UV__EAI_CANCELED (-3003)
  30. #define UV__EAI_FAIL (-3004)
  31. #define UV__EAI_FAMILY (-3005)
  32. #define UV__EAI_MEMORY (-3006)
  33. #define UV__EAI_NODATA (-3007)
  34. #define UV__EAI_NONAME (-3008)
  35. #define UV__EAI_OVERFLOW (-3009)
  36. #define UV__EAI_SERVICE (-3010)
  37. #define UV__EAI_SOCKTYPE (-3011)
  38. #define UV__EAI_SYSTEM (-3012) /* TODO(bnoordhuis) Return system error. */
  39. #define UV__EAI_BADHINTS (-3013)
  40. #define UV__EAI_PROTOCOL (-3014)
  41. /* Only map to the system errno on non-Windows platforms. It's apparently
  42. * a fairly common practice for Windows programmers to redefine errno codes.
  43. */
  44. #if defined(E2BIG) && !defined(_WIN32)
  45. # define UV__E2BIG (-E2BIG)
  46. #else
  47. # define UV__E2BIG (-4093)
  48. #endif
  49. #if defined(EACCES) && !defined(_WIN32)
  50. # define UV__EACCES (-EACCES)
  51. #else
  52. # define UV__EACCES (-4092)
  53. #endif
  54. #if defined(EADDRINFO) && !defined(_WIN32)
  55. # define UV__EADDRINFO EADDRINFO
  56. #else
  57. # define UV__EADDRINFO (-4091)
  58. #endif
  59. #if defined(EADDRINUSE) && !defined(_WIN32)
  60. # define UV__EADDRINUSE (-EADDRINUSE)
  61. #else
  62. # define UV__EADDRINUSE (-4091)
  63. #endif
  64. #if defined(EADDRNOTAVAIL) && !defined(_WIN32)
  65. # define UV__EADDRNOTAVAIL (-EADDRNOTAVAIL)
  66. #else
  67. # define UV__EADDRNOTAVAIL (-4090)
  68. #endif
  69. #if defined(EAFNOSUPPORT) && !defined(_WIN32)
  70. # define UV__EAFNOSUPPORT (-EAFNOSUPPORT)
  71. #else
  72. # define UV__EAFNOSUPPORT (-4089)
  73. #endif
  74. #if defined(EAGAIN) && !defined(_WIN32)
  75. # define UV__EAGAIN (-EAGAIN)
  76. #else
  77. # define UV__EAGAIN (-4088)
  78. #endif
  79. #if defined(EALREADY) && !defined(_WIN32)
  80. # define UV__EALREADY (-EALREADY)
  81. #else
  82. # define UV__EALREADY (-4084)
  83. #endif
  84. #if defined(EBADF) && !defined(_WIN32)
  85. # define UV__EBADF (-EBADF)
  86. #else
  87. # define UV__EBADF (-4083)
  88. #endif
  89. #if defined(EBUSY) && !defined(_WIN32)
  90. # define UV__EBUSY (-EBUSY)
  91. #else
  92. # define UV__EBUSY (-4082)
  93. #endif
  94. #if defined(ECANCELED) && !defined(_WIN32)
  95. # define UV__ECANCELED (-ECANCELED)
  96. #else
  97. # define UV__ECANCELED (-4081)
  98. #endif
  99. #if defined(ECHARSET) && !defined(_WIN32)
  100. # define UV__ECHARSET (-ECHARSET)
  101. #else
  102. # define UV__ECHARSET (-4080)
  103. #endif
  104. #if defined(ECONNABORTED) && !defined(_WIN32)
  105. # define UV__ECONNABORTED (-ECONNABORTED)
  106. #else
  107. # define UV__ECONNABORTED (-4079)
  108. #endif
  109. #if defined(ECONNREFUSED) && !defined(_WIN32)
  110. # define UV__ECONNREFUSED (-ECONNREFUSED)
  111. #else
  112. # define UV__ECONNREFUSED (-4078)
  113. #endif
  114. #if defined(ECONNRESET) && !defined(_WIN32)
  115. # define UV__ECONNRESET (-ECONNRESET)
  116. #else
  117. # define UV__ECONNRESET (-4077)
  118. #endif
  119. #if defined(EDESTADDRREQ) && !defined(_WIN32)
  120. # define UV__EDESTADDRREQ (-EDESTADDRREQ)
  121. #else
  122. # define UV__EDESTADDRREQ (-4076)
  123. #endif
  124. #if defined(EEXIST) && !defined(_WIN32)
  125. # define UV__EEXIST (-EEXIST)
  126. #else
  127. # define UV__EEXIST (-4075)
  128. #endif
  129. #if defined(EFAULT) && !defined(_WIN32)
  130. # define UV__EFAULT (-EFAULT)
  131. #else
  132. # define UV__EFAULT (-4074)
  133. #endif
  134. #if defined(EHOSTUNREACH) && !defined(_WIN32)
  135. # define UV__EHOSTUNREACH (-EHOSTUNREACH)
  136. #else
  137. # define UV__EHOSTUNREACH (-4073)
  138. #endif
  139. #if defined(EINTR) && !defined(_WIN32)
  140. # define UV__EINTR (-EINTR)
  141. #else
  142. # define UV__EINTR (-4072)
  143. #endif
  144. #if defined(EINVAL) && !defined(_WIN32)
  145. # define UV__EINVAL (-EINVAL)
  146. #else
  147. # define UV__EINVAL (-4071)
  148. #endif
  149. #if defined(EIO) && !defined(_WIN32)
  150. # define UV__EIO (-EIO)
  151. #else
  152. # define UV__EIO (-4070)
  153. #endif
  154. #if defined(EISCONN) && !defined(_WIN32)
  155. # define UV__EISCONN (-EISCONN)
  156. #else
  157. # define UV__EISCONN (-4069)
  158. #endif
  159. #if defined(EISDIR) && !defined(_WIN32)
  160. # define UV__EISDIR (-EISDIR)
  161. #else
  162. # define UV__EISDIR (-4068)
  163. #endif
  164. #if defined(ELOOP) && !defined(_WIN32)
  165. # define UV__ELOOP (-ELOOP)
  166. #else
  167. # define UV__ELOOP (-4067)
  168. #endif
  169. #if defined(EMFILE) && !defined(_WIN32)
  170. # define UV__EMFILE (-EMFILE)
  171. #else
  172. # define UV__EMFILE (-4066)
  173. #endif
  174. #if defined(EMSGSIZE) && !defined(_WIN32)
  175. # define UV__EMSGSIZE (-EMSGSIZE)
  176. #else
  177. # define UV__EMSGSIZE (-4065)
  178. #endif
  179. #if defined(ENAMETOOLONG) && !defined(_WIN32)
  180. # define UV__ENAMETOOLONG (-ENAMETOOLONG)
  181. #else
  182. # define UV__ENAMETOOLONG (-4064)
  183. #endif
  184. #if defined(ENETDOWN) && !defined(_WIN32)
  185. # define UV__ENETDOWN (-ENETDOWN)
  186. #else
  187. # define UV__ENETDOWN (-4063)
  188. #endif
  189. #if defined(ENETUNREACH) && !defined(_WIN32)
  190. # define UV__ENETUNREACH (-ENETUNREACH)
  191. #else
  192. # define UV__ENETUNREACH (-4062)
  193. #endif
  194. #if defined(ENFILE) && !defined(_WIN32)
  195. # define UV__ENFILE (-ENFILE)
  196. #else
  197. # define UV__ENFILE (-4061)
  198. #endif
  199. #if defined(ENOBUFS) && !defined(_WIN32)
  200. # define UV__ENOBUFS (-ENOBUFS)
  201. #else
  202. # define UV__ENOBUFS (-4060)
  203. #endif
  204. #if defined(ENODEV) && !defined(_WIN32)
  205. # define UV__ENODEV (-ENODEV)
  206. #else
  207. # define UV__ENODEV (-4059)
  208. #endif
  209. #if defined(ENOENT) && !defined(_WIN32)
  210. # define UV__ENOENT (-ENOENT)
  211. #else
  212. # define UV__ENOENT (-4058)
  213. #endif
  214. #if defined(ENOMEM) && !defined(_WIN32)
  215. # define UV__ENOMEM (-ENOMEM)
  216. #else
  217. # define UV__ENOMEM (-4057)
  218. #endif
  219. #if defined(ENONET) && !defined(_WIN32)
  220. # define UV__ENONET (-ENONET)
  221. #else
  222. # define UV__ENONET (-4056)
  223. #endif
  224. #if defined(ENOSPC) && !defined(_WIN32)
  225. # define UV__ENOSPC (-ENOSPC)
  226. #else
  227. # define UV__ENOSPC (-4055)
  228. #endif
  229. #if defined(ENOSYS) && !defined(_WIN32)
  230. # define UV__ENOSYS (-ENOSYS)
  231. #else
  232. # define UV__ENOSYS (-4054)
  233. #endif
  234. #if defined(ENOTCONN) && !defined(_WIN32)
  235. # define UV__ENOTCONN (-ENOTCONN)
  236. #else
  237. # define UV__ENOTCONN (-4053)
  238. #endif
  239. #if defined(ENOTDIR) && !defined(_WIN32)
  240. # define UV__ENOTDIR (-ENOTDIR)
  241. #else
  242. # define UV__ENOTDIR (-4052)
  243. #endif
  244. #if defined(ENOTEMPTY) && !defined(_WIN32)
  245. # define UV__ENOTEMPTY (-ENOTEMPTY)
  246. #else
  247. # define UV__ENOTEMPTY (-4051)
  248. #endif
  249. #if defined(ENOTSOCK) && !defined(_WIN32)
  250. # define UV__ENOTSOCK (-ENOTSOCK)
  251. #else
  252. # define UV__ENOTSOCK (-4050)
  253. #endif
  254. #if defined(ENOTSUP) && !defined(_WIN32)
  255. # define UV__ENOTSUP (-ENOTSUP)
  256. #else
  257. # define UV__ENOTSUP (-4049)
  258. #endif
  259. #if defined(EPERM) && !defined(_WIN32)
  260. # define UV__EPERM (-EPERM)
  261. #else
  262. # define UV__EPERM (-4048)
  263. #endif
  264. #if defined(EPIPE) && !defined(_WIN32)
  265. # define UV__EPIPE (-EPIPE)
  266. #else
  267. # define UV__EPIPE (-4047)
  268. #endif
  269. #if defined(EPROTO) && !defined(_WIN32)
  270. # define UV__EPROTO (-EPROTO)
  271. #else
  272. # define UV__EPROTO (-4046)
  273. #endif
  274. #if defined(EPROTONOSUPPORT) && !defined(_WIN32)
  275. # define UV__EPROTONOSUPPORT (-EPROTONOSUPPORT)
  276. #else
  277. # define UV__EPROTONOSUPPORT (-4045)
  278. #endif
  279. #if defined(EPROTOTYPE) && !defined(_WIN32)
  280. # define UV__EPROTOTYPE (-EPROTOTYPE)
  281. #else
  282. # define UV__EPROTOTYPE (-4044)
  283. #endif
  284. #if defined(EROFS) && !defined(_WIN32)
  285. # define UV__EROFS (-EROFS)
  286. #else
  287. # define UV__EROFS (-4043)
  288. #endif
  289. #if defined(ESHUTDOWN) && !defined(_WIN32)
  290. # define UV__ESHUTDOWN (-ESHUTDOWN)
  291. #else
  292. # define UV__ESHUTDOWN (-4042)
  293. #endif
  294. #if defined(ESPIPE) && !defined(_WIN32)
  295. # define UV__ESPIPE (-ESPIPE)
  296. #else
  297. # define UV__ESPIPE (-4041)
  298. #endif
  299. #if defined(ESRCH) && !defined(_WIN32)
  300. # define UV__ESRCH (-ESRCH)
  301. #else
  302. # define UV__ESRCH (-4040)
  303. #endif
  304. #if defined(ETIMEDOUT) && !defined(_WIN32)
  305. # define UV__ETIMEDOUT (-ETIMEDOUT)
  306. #else
  307. # define UV__ETIMEDOUT (-4039)
  308. #endif
  309. #if defined(EXDEV) && !defined(_WIN32)
  310. # define UV__EXDEV (-EXDEV)
  311. #else
  312. # define UV__EXDEV (-4037)
  313. #endif
  314. #endif /* UV_ERRNO_H_ */