Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 10:02:26

0001 /* Copyright Joyent, Inc. and other Node contributors. All rights reserved.
0002  *
0003  * Permission is hereby granted, free of charge, to any person obtaining a copy
0004  * of this software and associated documentation files (the "Software"), to
0005  * deal in the Software without restriction, including without limitation the
0006  * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
0007  * sell copies of the Software, and to permit persons to whom the Software is
0008  * furnished to do so, subject to the following conditions:
0009  *
0010  * The above copyright notice and this permission notice shall be included in
0011  * all copies or substantial portions of the Software.
0012  *
0013  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
0014  * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
0015  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
0016  * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
0017  * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
0018  * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
0019  * IN THE SOFTWARE.
0020  */
0021 
0022 #ifndef UV_ERRNO_H_
0023 #define UV_ERRNO_H_
0024 
0025 #include <errno.h>
0026 #if EDOM > 0
0027 # define UV__ERR(x) (-(x))
0028 #else
0029 # define UV__ERR(x) (x)
0030 #endif
0031 
0032 #define UV__EOF     (-4095)
0033 #define UV__UNKNOWN (-4094)
0034 
0035 #define UV__EAI_ADDRFAMILY  (-3000)
0036 #define UV__EAI_AGAIN       (-3001)
0037 #define UV__EAI_BADFLAGS    (-3002)
0038 #define UV__EAI_CANCELED    (-3003)
0039 #define UV__EAI_FAIL        (-3004)
0040 #define UV__EAI_FAMILY      (-3005)
0041 #define UV__EAI_MEMORY      (-3006)
0042 #define UV__EAI_NODATA      (-3007)
0043 #define UV__EAI_NONAME      (-3008)
0044 #define UV__EAI_OVERFLOW    (-3009)
0045 #define UV__EAI_SERVICE     (-3010)
0046 #define UV__EAI_SOCKTYPE    (-3011)
0047 #define UV__EAI_BADHINTS    (-3013)
0048 #define UV__EAI_PROTOCOL    (-3014)
0049 
0050 /* Only map to the system errno on non-Windows platforms. It's apparently
0051  * a fairly common practice for Windows programmers to redefine errno codes.
0052  */
0053 #if defined(E2BIG) && !defined(_WIN32)
0054 # define UV__E2BIG UV__ERR(E2BIG)
0055 #else
0056 # define UV__E2BIG (-4093)
0057 #endif
0058 
0059 #if defined(EACCES) && !defined(_WIN32)
0060 # define UV__EACCES UV__ERR(EACCES)
0061 #else
0062 # define UV__EACCES (-4092)
0063 #endif
0064 
0065 #if defined(EADDRINUSE) && !defined(_WIN32)
0066 # define UV__EADDRINUSE UV__ERR(EADDRINUSE)
0067 #else
0068 # define UV__EADDRINUSE (-4091)
0069 #endif
0070 
0071 #if defined(EADDRNOTAVAIL) && !defined(_WIN32)
0072 # define UV__EADDRNOTAVAIL UV__ERR(EADDRNOTAVAIL)
0073 #else
0074 # define UV__EADDRNOTAVAIL (-4090)
0075 #endif
0076 
0077 #if defined(EAFNOSUPPORT) && !defined(_WIN32)
0078 # define UV__EAFNOSUPPORT UV__ERR(EAFNOSUPPORT)
0079 #else
0080 # define UV__EAFNOSUPPORT (-4089)
0081 #endif
0082 
0083 #if defined(EAGAIN) && !defined(_WIN32)
0084 # define UV__EAGAIN UV__ERR(EAGAIN)
0085 #else
0086 # define UV__EAGAIN (-4088)
0087 #endif
0088 
0089 #if defined(EALREADY) && !defined(_WIN32)
0090 # define UV__EALREADY UV__ERR(EALREADY)
0091 #else
0092 # define UV__EALREADY (-4084)
0093 #endif
0094 
0095 #if defined(EBADF) && !defined(_WIN32)
0096 # define UV__EBADF UV__ERR(EBADF)
0097 #else
0098 # define UV__EBADF (-4083)
0099 #endif
0100 
0101 #if defined(EBUSY) && !defined(_WIN32)
0102 # define UV__EBUSY UV__ERR(EBUSY)
0103 #else
0104 # define UV__EBUSY (-4082)
0105 #endif
0106 
0107 #if defined(ECANCELED) && !defined(_WIN32)
0108 # define UV__ECANCELED UV__ERR(ECANCELED)
0109 #else
0110 # define UV__ECANCELED (-4081)
0111 #endif
0112 
0113 #if defined(ECHARSET) && !defined(_WIN32)
0114 # define UV__ECHARSET UV__ERR(ECHARSET)
0115 #else
0116 # define UV__ECHARSET (-4080)
0117 #endif
0118 
0119 #if defined(ECONNABORTED) && !defined(_WIN32)
0120 # define UV__ECONNABORTED UV__ERR(ECONNABORTED)
0121 #else
0122 # define UV__ECONNABORTED (-4079)
0123 #endif
0124 
0125 #if defined(ECONNREFUSED) && !defined(_WIN32)
0126 # define UV__ECONNREFUSED UV__ERR(ECONNREFUSED)
0127 #else
0128 # define UV__ECONNREFUSED (-4078)
0129 #endif
0130 
0131 #if defined(ECONNRESET) && !defined(_WIN32)
0132 # define UV__ECONNRESET UV__ERR(ECONNRESET)
0133 #else
0134 # define UV__ECONNRESET (-4077)
0135 #endif
0136 
0137 #if defined(EDESTADDRREQ) && !defined(_WIN32)
0138 # define UV__EDESTADDRREQ UV__ERR(EDESTADDRREQ)
0139 #else
0140 # define UV__EDESTADDRREQ (-4076)
0141 #endif
0142 
0143 #if defined(EEXIST) && !defined(_WIN32)
0144 # define UV__EEXIST UV__ERR(EEXIST)
0145 #else
0146 # define UV__EEXIST (-4075)
0147 #endif
0148 
0149 #if defined(EFAULT) && !defined(_WIN32)
0150 # define UV__EFAULT UV__ERR(EFAULT)
0151 #else
0152 # define UV__EFAULT (-4074)
0153 #endif
0154 
0155 #if defined(EHOSTUNREACH) && !defined(_WIN32)
0156 # define UV__EHOSTUNREACH UV__ERR(EHOSTUNREACH)
0157 #else
0158 # define UV__EHOSTUNREACH (-4073)
0159 #endif
0160 
0161 #if defined(EINTR) && !defined(_WIN32)
0162 # define UV__EINTR UV__ERR(EINTR)
0163 #else
0164 # define UV__EINTR (-4072)
0165 #endif
0166 
0167 #if defined(EINVAL) && !defined(_WIN32)
0168 # define UV__EINVAL UV__ERR(EINVAL)
0169 #else
0170 # define UV__EINVAL (-4071)
0171 #endif
0172 
0173 #if defined(EIO) && !defined(_WIN32)
0174 # define UV__EIO UV__ERR(EIO)
0175 #else
0176 # define UV__EIO (-4070)
0177 #endif
0178 
0179 #if defined(EISCONN) && !defined(_WIN32)
0180 # define UV__EISCONN UV__ERR(EISCONN)
0181 #else
0182 # define UV__EISCONN (-4069)
0183 #endif
0184 
0185 #if defined(EISDIR) && !defined(_WIN32)
0186 # define UV__EISDIR UV__ERR(EISDIR)
0187 #else
0188 # define UV__EISDIR (-4068)
0189 #endif
0190 
0191 #if defined(ELOOP) && !defined(_WIN32)
0192 # define UV__ELOOP UV__ERR(ELOOP)
0193 #else
0194 # define UV__ELOOP (-4067)
0195 #endif
0196 
0197 #if defined(EMFILE) && !defined(_WIN32)
0198 # define UV__EMFILE UV__ERR(EMFILE)
0199 #else
0200 # define UV__EMFILE (-4066)
0201 #endif
0202 
0203 #if defined(EMSGSIZE) && !defined(_WIN32)
0204 # define UV__EMSGSIZE UV__ERR(EMSGSIZE)
0205 #else
0206 # define UV__EMSGSIZE (-4065)
0207 #endif
0208 
0209 #if defined(ENAMETOOLONG) && !defined(_WIN32)
0210 # define UV__ENAMETOOLONG UV__ERR(ENAMETOOLONG)
0211 #else
0212 # define UV__ENAMETOOLONG (-4064)
0213 #endif
0214 
0215 #if defined(ENETDOWN) && !defined(_WIN32)
0216 # define UV__ENETDOWN UV__ERR(ENETDOWN)
0217 #else
0218 # define UV__ENETDOWN (-4063)
0219 #endif
0220 
0221 #if defined(ENETUNREACH) && !defined(_WIN32)
0222 # define UV__ENETUNREACH UV__ERR(ENETUNREACH)
0223 #else
0224 # define UV__ENETUNREACH (-4062)
0225 #endif
0226 
0227 #if defined(ENFILE) && !defined(_WIN32)
0228 # define UV__ENFILE UV__ERR(ENFILE)
0229 #else
0230 # define UV__ENFILE (-4061)
0231 #endif
0232 
0233 #if defined(ENOBUFS) && !defined(_WIN32)
0234 # define UV__ENOBUFS UV__ERR(ENOBUFS)
0235 #else
0236 # define UV__ENOBUFS (-4060)
0237 #endif
0238 
0239 #if defined(ENODEV) && !defined(_WIN32)
0240 # define UV__ENODEV UV__ERR(ENODEV)
0241 #else
0242 # define UV__ENODEV (-4059)
0243 #endif
0244 
0245 #if defined(ENOENT) && !defined(_WIN32)
0246 # define UV__ENOENT UV__ERR(ENOENT)
0247 #else
0248 # define UV__ENOENT (-4058)
0249 #endif
0250 
0251 #if defined(ENOMEM) && !defined(_WIN32)
0252 # define UV__ENOMEM UV__ERR(ENOMEM)
0253 #else
0254 # define UV__ENOMEM (-4057)
0255 #endif
0256 
0257 #if defined(ENONET) && !defined(_WIN32)
0258 # define UV__ENONET UV__ERR(ENONET)
0259 #else
0260 # define UV__ENONET (-4056)
0261 #endif
0262 
0263 #if defined(ENOSPC) && !defined(_WIN32)
0264 # define UV__ENOSPC UV__ERR(ENOSPC)
0265 #else
0266 # define UV__ENOSPC (-4055)
0267 #endif
0268 
0269 #if defined(ENOSYS) && !defined(_WIN32)
0270 # define UV__ENOSYS UV__ERR(ENOSYS)
0271 #else
0272 # define UV__ENOSYS (-4054)
0273 #endif
0274 
0275 #if defined(ENOTCONN) && !defined(_WIN32)
0276 # define UV__ENOTCONN UV__ERR(ENOTCONN)
0277 #else
0278 # define UV__ENOTCONN (-4053)
0279 #endif
0280 
0281 #if defined(ENOTDIR) && !defined(_WIN32)
0282 # define UV__ENOTDIR UV__ERR(ENOTDIR)
0283 #else
0284 # define UV__ENOTDIR (-4052)
0285 #endif
0286 
0287 #if defined(ENOTEMPTY) && !defined(_WIN32)
0288 # define UV__ENOTEMPTY UV__ERR(ENOTEMPTY)
0289 #else
0290 # define UV__ENOTEMPTY (-4051)
0291 #endif
0292 
0293 #if defined(ENOTSOCK) && !defined(_WIN32)
0294 # define UV__ENOTSOCK UV__ERR(ENOTSOCK)
0295 #else
0296 # define UV__ENOTSOCK (-4050)
0297 #endif
0298 
0299 #if defined(ENOTSUP) && !defined(_WIN32)
0300 # define UV__ENOTSUP UV__ERR(ENOTSUP)
0301 #else
0302 # define UV__ENOTSUP (-4049)
0303 #endif
0304 
0305 #if defined(EPERM) && !defined(_WIN32)
0306 # define UV__EPERM UV__ERR(EPERM)
0307 #else
0308 # define UV__EPERM (-4048)
0309 #endif
0310 
0311 #if defined(EPIPE) && !defined(_WIN32)
0312 # define UV__EPIPE UV__ERR(EPIPE)
0313 #else
0314 # define UV__EPIPE (-4047)
0315 #endif
0316 
0317 #if defined(EPROTO) && !defined(_WIN32)
0318 # define UV__EPROTO UV__ERR(EPROTO)
0319 #else
0320 # define UV__EPROTO (-4046)
0321 #endif
0322 
0323 #if defined(EPROTONOSUPPORT) && !defined(_WIN32)
0324 # define UV__EPROTONOSUPPORT UV__ERR(EPROTONOSUPPORT)
0325 #else
0326 # define UV__EPROTONOSUPPORT (-4045)
0327 #endif
0328 
0329 #if defined(EPROTOTYPE) && !defined(_WIN32)
0330 # define UV__EPROTOTYPE UV__ERR(EPROTOTYPE)
0331 #else
0332 # define UV__EPROTOTYPE (-4044)
0333 #endif
0334 
0335 #if defined(EROFS) && !defined(_WIN32)
0336 # define UV__EROFS UV__ERR(EROFS)
0337 #else
0338 # define UV__EROFS (-4043)
0339 #endif
0340 
0341 #if defined(ESHUTDOWN) && !defined(_WIN32)
0342 # define UV__ESHUTDOWN UV__ERR(ESHUTDOWN)
0343 #else
0344 # define UV__ESHUTDOWN (-4042)
0345 #endif
0346 
0347 #if defined(ESPIPE) && !defined(_WIN32)
0348 # define UV__ESPIPE UV__ERR(ESPIPE)
0349 #else
0350 # define UV__ESPIPE (-4041)
0351 #endif
0352 
0353 #if defined(ESRCH) && !defined(_WIN32)
0354 # define UV__ESRCH UV__ERR(ESRCH)
0355 #else
0356 # define UV__ESRCH (-4040)
0357 #endif
0358 
0359 #if defined(ETIMEDOUT) && !defined(_WIN32)
0360 # define UV__ETIMEDOUT UV__ERR(ETIMEDOUT)
0361 #else
0362 # define UV__ETIMEDOUT (-4039)
0363 #endif
0364 
0365 #if defined(ETXTBSY) && !defined(_WIN32)
0366 # define UV__ETXTBSY UV__ERR(ETXTBSY)
0367 #else
0368 # define UV__ETXTBSY (-4038)
0369 #endif
0370 
0371 #if defined(EXDEV) && !defined(_WIN32)
0372 # define UV__EXDEV UV__ERR(EXDEV)
0373 #else
0374 # define UV__EXDEV (-4037)
0375 #endif
0376 
0377 #if defined(EFBIG) && !defined(_WIN32)
0378 # define UV__EFBIG UV__ERR(EFBIG)
0379 #else
0380 # define UV__EFBIG (-4036)
0381 #endif
0382 
0383 #if defined(ENOPROTOOPT) && !defined(_WIN32)
0384 # define UV__ENOPROTOOPT UV__ERR(ENOPROTOOPT)
0385 #else
0386 # define UV__ENOPROTOOPT (-4035)
0387 #endif
0388 
0389 #if defined(ERANGE) && !defined(_WIN32)
0390 # define UV__ERANGE UV__ERR(ERANGE)
0391 #else
0392 # define UV__ERANGE (-4034)
0393 #endif
0394 
0395 #if defined(ENXIO) && !defined(_WIN32)
0396 # define UV__ENXIO UV__ERR(ENXIO)
0397 #else
0398 # define UV__ENXIO (-4033)
0399 #endif
0400 
0401 #if defined(EMLINK) && !defined(_WIN32)
0402 # define UV__EMLINK UV__ERR(EMLINK)
0403 #else
0404 # define UV__EMLINK (-4032)
0405 #endif
0406 
0407 /* EHOSTDOWN is not visible on BSD-like systems when _POSIX_C_SOURCE is
0408  * defined. Fortunately, its value is always 64 so it's possible albeit
0409  * icky to hard-code it.
0410  */
0411 #if defined(EHOSTDOWN) && !defined(_WIN32)
0412 # define UV__EHOSTDOWN UV__ERR(EHOSTDOWN)
0413 #elif defined(__APPLE__) || \
0414       defined(__DragonFly__) || \
0415       defined(__FreeBSD__) || \
0416       defined(__NetBSD__) || \
0417       defined(__OpenBSD__)
0418 # define UV__EHOSTDOWN (-64)
0419 #else
0420 # define UV__EHOSTDOWN (-4031)
0421 #endif
0422 
0423 #if defined(EREMOTEIO) && !defined(_WIN32)
0424 # define UV__EREMOTEIO UV__ERR(EREMOTEIO)
0425 #else
0426 # define UV__EREMOTEIO (-4030)
0427 #endif
0428 
0429 #if defined(ENOTTY) && !defined(_WIN32)
0430 # define UV__ENOTTY UV__ERR(ENOTTY)
0431 #else
0432 # define UV__ENOTTY (-4029)
0433 #endif
0434 
0435 #if defined(EFTYPE) && !defined(_WIN32)
0436 # define UV__EFTYPE UV__ERR(EFTYPE)
0437 #else
0438 # define UV__EFTYPE (-4028)
0439 #endif
0440 
0441 #if defined(EILSEQ) && !defined(_WIN32)
0442 # define UV__EILSEQ UV__ERR(EILSEQ)
0443 #else
0444 # define UV__EILSEQ (-4027)
0445 #endif
0446 
0447 #if defined(EOVERFLOW) && !defined(_WIN32)
0448 # define UV__EOVERFLOW UV__ERR(EOVERFLOW)
0449 #else
0450 # define UV__EOVERFLOW (-4026)
0451 #endif
0452 
0453 #if defined(ESOCKTNOSUPPORT) && !defined(_WIN32)
0454 # define UV__ESOCKTNOSUPPORT UV__ERR(ESOCKTNOSUPPORT)
0455 #else
0456 # define UV__ESOCKTNOSUPPORT (-4025)
0457 #endif
0458 
0459 /* FreeBSD defines ENODATA in /usr/include/c++/v1/errno.h which is only visible
0460  * if C++ is being used. Define it directly to avoid problems when integrating
0461  * libuv in a C++ project.
0462  */
0463 #if defined(ENODATA) && !defined(_WIN32)
0464 # define UV__ENODATA UV__ERR(ENODATA)
0465 #elif defined(__FreeBSD__)
0466 # define UV__ENODATA (-9919)
0467 #else
0468 # define UV__ENODATA (-4024)
0469 #endif
0470 
0471 #if defined(EUNATCH) && !defined(_WIN32)
0472 # define UV__EUNATCH UV__ERR(EUNATCH)
0473 #else
0474 # define UV__EUNATCH (-4023)
0475 #endif
0476 
0477 #endif /* UV_ERRNO_H_ */