2 //===-------------------------- cerrno ------------------------------------===//
4 // The LLVM Compiler Infrastructure
6 // This file is dual licensed under the MIT and the University of Illinois Open
7 // Source Licenses. See LICENSE.TXT for details.
9 //===----------------------------------------------------------------------===//
11 #ifndef _LIBCPP_CERRNO
12 #define _LIBCPP_CERRNO
29 #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
30 #pragma GCC system_header
33 #if !defined(EOWNERDEAD) || !defined(ENOTRECOVERABLE)
37 const int __elast1 = ELAST+1;
38 const int __elast2 = ELAST+2;
42 const int __elast1 = 104;
43 const int __elast2 = 105;
47 #ifdef ENOTRECOVERABLE
49 #define EOWNERDEAD __elast1
53 #define ELAST EOWNERDEAD
56 #elif defined(EOWNERDEAD)
58 #define ENOTRECOVERABLE __elast1
61 #define ELAST ENOTRECOVERABLE
64 #else // defined(EOWNERDEAD)
66 #define EOWNERDEAD __elast1
67 #define ENOTRECOVERABLE __elast2
70 #define ELAST ENOTRECOVERABLE
73 #endif // defined(EOWNERDEAD)
75 #endif // !defined(EOWNERDEAD) || !defined(ENOTRECOVERABLE)
77 // supply errno values likely to be missing, particularly on Windows
80 #define EAFNOSUPPORT 9901
84 #define EADDRINUSE 9902
88 #define EADDRNOTAVAIL 9903
100 #define ECONNABORTED 9906
104 #define EALREADY 9907
108 #define ECONNREFUSED 9908
112 #define ECONNRESET 9909
116 #define EDESTADDRREQ 9910
120 #define EHOSTUNREACH 9911
128 #define EMSGSIZE 9913
132 #define ENETDOWN 9914
136 #define ENETRESET 9915
140 #define ENETUNREACH 9916
160 #define ENOPROTOOPT 9921
168 #define ENOTSOCK 9923
176 #define ENOTCONN 9925
184 #define ECANCELED 9927
188 #define EINPROGRESS 9928
192 #define EOPNOTSUPP 9929
196 #define EWOULDBLOCK 9930
200 #define EOWNERDEAD 9931
207 #ifndef EPROTONOSUPPORT
208 #define EPROTONOSUPPORT 9933
211 #ifndef ENOTRECOVERABLE
212 #define ENOTRECOVERABLE 9934
224 #define ETIMEDOUT 9938
232 #define EOVERFLOW 9940
236 #define EPROTOTYPE 9941
255 // Windows Mobile doesn't appear to define these:
286 #define ENOTEMPTY 9953
302 #define ENAMETOOLONG 9957
393 #endif // _LIBCPP_CERRNO