2 //===-------------------------- errno.h -----------------------------------===//
4 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
5 // See https://llvm.org/LICENSE.txt for license information.
6 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
8 //===----------------------------------------------------------------------===//
10 #ifndef _LIBCPP_ERRNO_H
11 #define _LIBCPP_ERRNO_H
27 #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
28 #pragma GCC system_header
31 #include_next <errno.h>
35 #if !defined(EOWNERDEAD) || !defined(ENOTRECOVERABLE) || !defined(EINTEGRITY)
39 static const int __elast1 = ELAST+1;
40 static const int __elast2 = ELAST+2;
41 static const int __elast3 = ELAST+3;
45 static const int __elast1 = 104;
46 static const int __elast2 = 105;
47 static const int __elast3 = 106;
51 #if !defined(EOWNERDEAD) && !defined(ENOTRECOVERABLE) && !defined(EINTEGRITY)
52 #define ENOTRECOVERABLE __elast1
53 #define EOWNERDEAD __elast2
54 #define EINTEGRITY __elast3
57 #define ELAST EINTEGRITY
60 #elif !defined(EOWNERDEAD) && !defined(ENOTRECOVERABLE) && defined(EINTEGRITY)
61 #define ENOTRECOVERABLE __elast1
62 #define EOWNERDEAD __elast2
65 #define ELAST EOWNERDEAD
68 #elif !defined(EOWNERDEAD) && defined(ENOTRECOVERABLE) && !defined(EINTEGRITY)
69 #define EOWNERDEAD __elast1
70 #define EINTEGRITY __elast2
73 #define ELAST EINTEGRITY
76 #elif !defined(EOWNERDEAD) && defined(ENOTRECOVERABLE) && defined(EINTEGRITY)
77 #define EOWNERDEAD __elast1
80 #define ELAST EOWNERDEAD
83 #elif defined(EOWNERDEAD) && !defined(ENOTRECOVERABLE) && !defined(EINTEGRITY)
84 #define ENOTRECOVERABLE __elast1
85 #define EINTEGRITY __elast2
88 #define ELAST EINTEGRITY
91 #elif defined(EOWNERDEAD) && !defined(ENOTRECOVERABLE) && defined(EINTEGRITY)
92 #define ENOTRECOVERABLE __elast1
95 #define ELAST ENOTRECOVERABLE
98 #elif defined(EOWNERDEAD) && defined(ENOTRECOVERABLE) && !defined(EINTEGRITY)
99 #define EINTEGRITY __elast1
102 #define ELAST EINTEGRITY
105 #endif // !defined(OWNERDEAD) && !defined(NOTRECOVERABLE) && !defined(INTEGRITY)
107 #endif // !defined(OWNERDEAD) || !defined(NOTRECOVERABLE) || !defined(INTEGRITY)
109 // supply errno values likely to be missing, particularly on Windows
112 #define EAFNOSUPPORT 9901
116 #define EADDRINUSE 9902
119 #ifndef EADDRNOTAVAIL
120 #define EADDRNOTAVAIL 9903
132 #define ECONNABORTED 9906
136 #define EALREADY 9907
140 #define ECONNREFUSED 9908
144 #define ECONNRESET 9909
148 #define EDESTADDRREQ 9910
152 #define EHOSTUNREACH 9911
160 #define EMSGSIZE 9913
164 #define ENETDOWN 9914
168 #define ENETRESET 9915
172 #define ENETUNREACH 9916
192 #define ENOPROTOOPT 9921
200 #define ENOTSOCK 9923
208 #define ENOTCONN 9925
216 #define ECANCELED 9927
220 #define EINPROGRESS 9928
224 #define EOPNOTSUPP 9929
228 #define EWOULDBLOCK 9930
232 #define EOWNERDEAD 9931
239 #ifndef EPROTONOSUPPORT
240 #define EPROTONOSUPPORT 9933
243 #ifndef ENOTRECOVERABLE
244 #define ENOTRECOVERABLE 9934
256 #define ETIMEDOUT 9938
264 #define EOVERFLOW 9940
268 #define EPROTOTYPE 9941
287 // Windows Mobile doesn't appear to define these:
318 #define ENOTEMPTY 9953
334 #define ENAMETOOLONG 9957
426 #define EINTEGRITY 9980
429 #endif // __cplusplus
431 #endif // _LIBCPP_ERRNO_H