]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - contrib/libc++/include/errno.h
scp: validate filenames provided by server against wildcard in client
[FreeBSD/FreeBSD.git] / contrib / libc++ / include / errno.h
1 // -*- C++ -*-
2 //===-------------------------- errno.h -----------------------------------===//
3 //
4 //                     The LLVM Compiler Infrastructure
5 //
6 // This file is dual licensed under the MIT and the University of Illinois Open
7 // Source Licenses. See LICENSE.TXT for details.
8 //
9 //===----------------------------------------------------------------------===//
10
11 #ifndef _LIBCPP_ERRNO_H
12 #define _LIBCPP_ERRNO_H
13
14 /*
15     errno.h synopsis
16
17 Macros:
18
19     EDOM
20     EILSEQ  // C99
21     ERANGE
22     errno
23
24 */
25
26 #include <__config>
27
28 #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
29 #pragma GCC system_header
30 #endif
31
32 #include_next <errno.h>
33
34 #ifdef __cplusplus
35
36 #if !defined(EOWNERDEAD) || !defined(ENOTRECOVERABLE) || !defined(EINTEGRITY)
37
38 #if defined(ELAST)
39
40 static const int __elast1 = ELAST+1;
41 static const int __elast2 = ELAST+2;
42 static const int __elast3 = ELAST+3;
43
44 #else
45
46 static const int __elast1 = 104;
47 static const int __elast2 = 105;
48 static const int __elast3 = 106;
49
50 #endif
51
52 #if !defined(EOWNERDEAD) && !defined(ENOTRECOVERABLE) && !defined(EINTEGRITY)
53 #define ENOTRECOVERABLE __elast1
54 #define EOWNERDEAD __elast2
55 #define EINTEGRITY __elast3
56 #if defined(ELAST)
57 #undef ELAST
58 #define ELAST EINTEGRITY
59 #endif
60
61 #elif !defined(EOWNERDEAD) && !defined(ENOTRECOVERABLE) && defined(EINTEGRITY)
62 #define ENOTRECOVERABLE __elast1
63 #define EOWNERDEAD __elast2
64 #if defined(ELAST)
65 #undef ELAST
66 #define ELAST EOWNERDEAD
67 #endif
68
69 #elif !defined(EOWNERDEAD) && defined(ENOTRECOVERABLE) && !defined(EINTEGRITY)
70 #define EOWNERDEAD __elast1
71 #define EINTEGRITY __elast2
72 #if defined(ELAST)
73 #undef ELAST
74 #define ELAST EINTEGRITY
75 #endif
76
77 #elif !defined(EOWNERDEAD) && defined(ENOTRECOVERABLE) && defined(EINTEGRITY)
78 #define EOWNERDEAD __elast1
79 #if defined(ELAST)
80 #undef ELAST
81 #define ELAST EOWNERDEAD
82 #endif
83
84 #elif defined(EOWNERDEAD) && !defined(ENOTRECOVERABLE) && !defined(EINTEGRITY)
85 #define ENOTRECOVERABLE __elast1
86 #define EINTEGRITY __elast2
87 #if defined(ELAST)
88 #undef ELAST
89 #define ELAST EINTEGRITY
90 #endif
91
92 #elif defined(EOWNERDEAD) && !defined(ENOTRECOVERABLE) && defined(EINTEGRITY)
93 #define ENOTRECOVERABLE __elast1
94 #if defined(ELAST)
95 #undef ELAST
96 #define ELAST ENOTRECOVERABLE
97 #endif
98
99 #elif defined(EOWNERDEAD) && defined(ENOTRECOVERABLE) && !defined(EINTEGRITY)
100 #define EINTEGRITY __elast1
101 #if defined(ELAST)
102 #undef ELAST
103 #define ELAST EINTEGRITY
104 #endif
105
106 #endif // !defined(OWNERDEAD) && !defined(NOTRECOVERABLE) && !defined(INTEGRITY)
107
108 #endif // !defined(OWNERDEAD) || !defined(NOTRECOVERABLE) || !defined(INTEGRITY)
109
110 //  supply errno values likely to be missing, particularly on Windows
111
112 #ifndef EAFNOSUPPORT
113 #define EAFNOSUPPORT 9901
114 #endif
115
116 #ifndef EADDRINUSE
117 #define EADDRINUSE 9902
118 #endif
119
120 #ifndef EADDRNOTAVAIL
121 #define EADDRNOTAVAIL 9903
122 #endif
123
124 #ifndef EISCONN
125 #define EISCONN 9904
126 #endif
127
128 #ifndef EBADMSG
129 #define EBADMSG 9905
130 #endif
131
132 #ifndef ECONNABORTED
133 #define ECONNABORTED 9906
134 #endif
135
136 #ifndef EALREADY
137 #define EALREADY 9907
138 #endif
139
140 #ifndef ECONNREFUSED
141 #define ECONNREFUSED 9908
142 #endif
143
144 #ifndef ECONNRESET
145 #define ECONNRESET 9909
146 #endif
147
148 #ifndef EDESTADDRREQ
149 #define EDESTADDRREQ 9910
150 #endif
151
152 #ifndef EHOSTUNREACH
153 #define EHOSTUNREACH 9911
154 #endif
155
156 #ifndef EIDRM
157 #define EIDRM 9912
158 #endif
159
160 #ifndef EMSGSIZE
161 #define EMSGSIZE 9913
162 #endif
163
164 #ifndef ENETDOWN
165 #define ENETDOWN 9914
166 #endif
167
168 #ifndef ENETRESET
169 #define ENETRESET 9915
170 #endif
171
172 #ifndef ENETUNREACH
173 #define ENETUNREACH 9916
174 #endif
175
176 #ifndef ENOBUFS
177 #define ENOBUFS 9917
178 #endif
179
180 #ifndef ENOLINK
181 #define ENOLINK 9918
182 #endif
183
184 #ifndef ENODATA
185 #define ENODATA 9919
186 #endif
187
188 #ifndef ENOMSG
189 #define ENOMSG 9920
190 #endif
191
192 #ifndef ENOPROTOOPT
193 #define ENOPROTOOPT 9921
194 #endif
195
196 #ifndef ENOSR
197 #define ENOSR 9922
198 #endif
199
200 #ifndef ENOTSOCK
201 #define ENOTSOCK 9923
202 #endif
203
204 #ifndef ENOSTR
205 #define ENOSTR 9924
206 #endif
207
208 #ifndef ENOTCONN
209 #define ENOTCONN 9925
210 #endif
211
212 #ifndef ENOTSUP
213 #define ENOTSUP 9926
214 #endif
215
216 #ifndef ECANCELED
217 #define ECANCELED 9927
218 #endif
219
220 #ifndef EINPROGRESS
221 #define EINPROGRESS 9928
222 #endif
223
224 #ifndef EOPNOTSUPP
225 #define EOPNOTSUPP 9929
226 #endif
227
228 #ifndef EWOULDBLOCK
229 #define EWOULDBLOCK 9930
230 #endif
231
232 #ifndef EOWNERDEAD
233 #define EOWNERDEAD  9931
234 #endif
235
236 #ifndef EPROTO
237 #define EPROTO 9932
238 #endif
239
240 #ifndef EPROTONOSUPPORT
241 #define EPROTONOSUPPORT 9933
242 #endif
243
244 #ifndef ENOTRECOVERABLE
245 #define ENOTRECOVERABLE 9934
246 #endif
247
248 #ifndef ETIME
249 #define ETIME 9935
250 #endif
251
252 #ifndef ETXTBSY
253 #define ETXTBSY 9936
254 #endif
255
256 #ifndef ETIMEDOUT
257 #define ETIMEDOUT 9938
258 #endif
259
260 #ifndef ELOOP
261 #define ELOOP 9939
262 #endif
263
264 #ifndef EOVERFLOW
265 #define EOVERFLOW 9940
266 #endif
267
268 #ifndef EPROTOTYPE
269 #define EPROTOTYPE 9941
270 #endif
271
272 #ifndef ENOSYS
273 #define ENOSYS 9942
274 #endif
275
276 #ifndef EINVAL
277 #define EINVAL 9943
278 #endif
279
280 #ifndef ERANGE
281 #define ERANGE 9944
282 #endif
283
284 #ifndef EILSEQ
285 #define EILSEQ 9945
286 #endif
287
288 //  Windows Mobile doesn't appear to define these:
289
290 #ifndef E2BIG
291 #define E2BIG 9946
292 #endif
293
294 #ifndef EDOM
295 #define EDOM 9947
296 #endif
297
298 #ifndef EFAULT
299 #define EFAULT 9948
300 #endif
301
302 #ifndef EBADF
303 #define EBADF 9949
304 #endif
305
306 #ifndef EPIPE
307 #define EPIPE 9950
308 #endif
309
310 #ifndef EXDEV
311 #define EXDEV 9951
312 #endif
313
314 #ifndef EBUSY
315 #define EBUSY 9952
316 #endif
317
318 #ifndef ENOTEMPTY
319 #define ENOTEMPTY 9953
320 #endif
321
322 #ifndef ENOEXEC
323 #define ENOEXEC 9954
324 #endif
325
326 #ifndef EEXIST
327 #define EEXIST 9955
328 #endif
329
330 #ifndef EFBIG
331 #define EFBIG 9956
332 #endif
333
334 #ifndef ENAMETOOLONG
335 #define ENAMETOOLONG 9957
336 #endif
337
338 #ifndef ENOTTY
339 #define ENOTTY 9958
340 #endif
341
342 #ifndef EINTR
343 #define EINTR 9959
344 #endif
345
346 #ifndef ESPIPE
347 #define ESPIPE 9960
348 #endif
349
350 #ifndef EIO
351 #define EIO 9961
352 #endif
353
354 #ifndef EISDIR
355 #define EISDIR 9962
356 #endif
357
358 #ifndef ECHILD
359 #define ECHILD 9963
360 #endif
361
362 #ifndef ENOLCK
363 #define ENOLCK 9964
364 #endif
365
366 #ifndef ENOSPC
367 #define ENOSPC 9965
368 #endif
369
370 #ifndef ENXIO
371 #define ENXIO 9966
372 #endif
373
374 #ifndef ENODEV
375 #define ENODEV 9967
376 #endif
377
378 #ifndef ENOENT
379 #define ENOENT 9968
380 #endif
381
382 #ifndef ESRCH
383 #define ESRCH 9969
384 #endif
385
386 #ifndef ENOTDIR
387 #define ENOTDIR 9970
388 #endif
389
390 #ifndef ENOMEM
391 #define ENOMEM 9971
392 #endif
393
394 #ifndef EPERM
395 #define EPERM 9972
396 #endif
397
398 #ifndef EACCES
399 #define EACCES 9973
400 #endif
401
402 #ifndef EROFS
403 #define EROFS 9974
404 #endif
405
406 #ifndef EDEADLK
407 #define EDEADLK 9975
408 #endif
409
410 #ifndef EAGAIN
411 #define EAGAIN 9976
412 #endif
413
414 #ifndef ENFILE
415 #define ENFILE 9977
416 #endif
417
418 #ifndef EMFILE
419 #define EMFILE 9978
420 #endif
421
422 #ifndef EMLINK
423 #define EMLINK 9979
424 #endif
425
426 #ifndef EINTEGRITY
427 #define EINTEGRITY 9980
428 #endif
429
430 #endif // __cplusplus
431
432 #endif  // _LIBCPP_ERRNO_H