2 //===-------------------------- errno.h -----------------------------------===//
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_ERRNO_H
12 #define _LIBCPP_ERRNO_H
28 #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
29 #pragma GCC system_header
32 #include_next <errno.h>
36 #if !defined(EOWNERDEAD) || !defined(ENOTRECOVERABLE) || !defined(EINTEGRITY)
40 static const int __elast1 = ELAST+1;
41 static const int __elast2 = ELAST+2;
42 static const int __elast3 = ELAST+3;
46 static const int __elast1 = 104;
47 static const int __elast2 = 105;
48 static const int __elast3 = 106;
52 #if !defined(EOWNERDEAD) && !defined(ENOTRECOVERABLE) && !defined(EINTEGRITY)
53 #define ENOTRECOVERABLE __elast1
54 #define EOWNERDEAD __elast2
55 #define EINTEGRITY __elast3
58 #define ELAST EINTEGRITY
61 #elif !defined(EOWNERDEAD) && !defined(ENOTRECOVERABLE) && defined(EINTEGRITY)
62 #define ENOTRECOVERABLE __elast1
63 #define EOWNERDEAD __elast2
66 #define ELAST EOWNERDEAD
69 #elif !defined(EOWNERDEAD) && defined(ENOTRECOVERABLE) && !defined(EINTEGRITY)
70 #define EOWNERDEAD __elast1
71 #define EINTEGRITY __elast2
74 #define ELAST EINTEGRITY
77 #elif !defined(EOWNERDEAD) && defined(ENOTRECOVERABLE) && defined(EINTEGRITY)
78 #define EOWNERDEAD __elast1
81 #define ELAST EOWNERDEAD
84 #elif defined(EOWNERDEAD) && !defined(ENOTRECOVERABLE) && !defined(EINTEGRITY)
85 #define ENOTRECOVERABLE __elast1
86 #define EINTEGRITY __elast2
89 #define ELAST EINTEGRITY
92 #elif defined(EOWNERDEAD) && !defined(ENOTRECOVERABLE) && defined(EINTEGRITY)
93 #define ENOTRECOVERABLE __elast1
96 #define ELAST ENOTRECOVERABLE
99 #elif defined(EOWNERDEAD) && defined(ENOTRECOVERABLE) && !defined(EINTEGRITY)
100 #define EINTEGRITY __elast1
103 #define ELAST EINTEGRITY
106 #endif // !defined(OWNERDEAD) && !defined(NOTRECOVERABLE) && !defined(INTEGRITY)
108 #endif // !defined(OWNERDEAD) || !defined(NOTRECOVERABLE) || !defined(INTEGRITY)
110 // supply errno values likely to be missing, particularly on Windows
113 #define EAFNOSUPPORT 9901
117 #define EADDRINUSE 9902
120 #ifndef EADDRNOTAVAIL
121 #define EADDRNOTAVAIL 9903
133 #define ECONNABORTED 9906
137 #define EALREADY 9907
141 #define ECONNREFUSED 9908
145 #define ECONNRESET 9909
149 #define EDESTADDRREQ 9910
153 #define EHOSTUNREACH 9911
161 #define EMSGSIZE 9913
165 #define ENETDOWN 9914
169 #define ENETRESET 9915
173 #define ENETUNREACH 9916
193 #define ENOPROTOOPT 9921
201 #define ENOTSOCK 9923
209 #define ENOTCONN 9925
217 #define ECANCELED 9927
221 #define EINPROGRESS 9928
225 #define EOPNOTSUPP 9929
229 #define EWOULDBLOCK 9930
233 #define EOWNERDEAD 9931
240 #ifndef EPROTONOSUPPORT
241 #define EPROTONOSUPPORT 9933
244 #ifndef ENOTRECOVERABLE
245 #define ENOTRECOVERABLE 9934
257 #define ETIMEDOUT 9938
265 #define EOVERFLOW 9940
269 #define EPROTOTYPE 9941
288 // Windows Mobile doesn't appear to define these:
319 #define ENOTEMPTY 9953
335 #define ENAMETOOLONG 9957
427 #define EINTEGRITY 9980
430 #endif // __cplusplus
432 #endif // _LIBCPP_ERRNO_H