btrfs: [] on the end of a struct field is a variable length array.
[haiku.git] / headers / libs / libc++ / errno.h
blobee6429110cc12836d3ffaf2e7430692ead2b3249
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 //===----------------------------------------------------------------------===//
11 #ifndef _LIBCPP_ERRNO_H
12 #define _LIBCPP_ERRNO_H
15 errno.h synopsis
17 Macros:
19 EDOM
20 EILSEQ // C99
21 ERANGE
22 errno
26 #include <__config>
28 #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
29 #pragma GCC system_header
30 #endif
32 #include_next <errno.h>
34 #ifdef __cplusplus
36 #if !defined(EOWNERDEAD) || !defined(ENOTRECOVERABLE)
38 #ifdef ELAST
40 static const int __elast1 = ELAST+1;
41 static const int __elast2 = ELAST+2;
43 #else
45 static const int __elast1 = 104;
46 static const int __elast2 = 105;
48 #endif
50 #ifdef ENOTRECOVERABLE
52 #define EOWNERDEAD __elast1
54 #ifdef ELAST
55 #undef ELAST
56 #define ELAST EOWNERDEAD
57 #endif
59 #elif defined(EOWNERDEAD)
61 #define ENOTRECOVERABLE __elast1
62 #ifdef ELAST
63 #undef ELAST
64 #define ELAST ENOTRECOVERABLE
65 #endif
67 #else // defined(EOWNERDEAD)
69 #define EOWNERDEAD __elast1
70 #define ENOTRECOVERABLE __elast2
71 #ifdef ELAST
72 #undef ELAST
73 #define ELAST ENOTRECOVERABLE
74 #endif
76 #endif // defined(EOWNERDEAD)
78 #endif // !defined(EOWNERDEAD) || !defined(ENOTRECOVERABLE)
80 // supply errno values likely to be missing, particularly on Windows
82 #ifndef EAFNOSUPPORT
83 #define EAFNOSUPPORT 9901
84 #endif
86 #ifndef EADDRINUSE
87 #define EADDRINUSE 9902
88 #endif
90 #ifndef EADDRNOTAVAIL
91 #define EADDRNOTAVAIL 9903
92 #endif
94 #ifndef EISCONN
95 #define EISCONN 9904
96 #endif
98 #ifndef EBADMSG
99 #define EBADMSG 9905
100 #endif
102 #ifndef ECONNABORTED
103 #define ECONNABORTED 9906
104 #endif
106 #ifndef EALREADY
107 #define EALREADY 9907
108 #endif
110 #ifndef ECONNREFUSED
111 #define ECONNREFUSED 9908
112 #endif
114 #ifndef ECONNRESET
115 #define ECONNRESET 9909
116 #endif
118 #ifndef EDESTADDRREQ
119 #define EDESTADDRREQ 9910
120 #endif
122 #ifndef EHOSTUNREACH
123 #define EHOSTUNREACH 9911
124 #endif
126 #ifndef EIDRM
127 #define EIDRM 9912
128 #endif
130 #ifndef EMSGSIZE
131 #define EMSGSIZE 9913
132 #endif
134 #ifndef ENETDOWN
135 #define ENETDOWN 9914
136 #endif
138 #ifndef ENETRESET
139 #define ENETRESET 9915
140 #endif
142 #ifndef ENETUNREACH
143 #define ENETUNREACH 9916
144 #endif
146 #ifndef ENOBUFS
147 #define ENOBUFS 9917
148 #endif
150 #ifndef ENOLINK
151 #define ENOLINK 9918
152 #endif
154 #ifndef ENODATA
155 #define ENODATA 9919
156 #endif
158 #ifndef ENOMSG
159 #define ENOMSG 9920
160 #endif
162 #ifndef ENOPROTOOPT
163 #define ENOPROTOOPT 9921
164 #endif
166 #ifndef ENOSR
167 #define ENOSR 9922
168 #endif
170 #ifndef ENOTSOCK
171 #define ENOTSOCK 9923
172 #endif
174 #ifndef ENOSTR
175 #define ENOSTR 9924
176 #endif
178 #ifndef ENOTCONN
179 #define ENOTCONN 9925
180 #endif
182 #ifndef ENOTSUP
183 #define ENOTSUP 9926
184 #endif
186 #ifndef ECANCELED
187 #define ECANCELED 9927
188 #endif
190 #ifndef EINPROGRESS
191 #define EINPROGRESS 9928
192 #endif
194 #ifndef EOPNOTSUPP
195 #define EOPNOTSUPP 9929
196 #endif
198 #ifndef EWOULDBLOCK
199 #define EWOULDBLOCK 9930
200 #endif
202 #ifndef EOWNERDEAD
203 #define EOWNERDEAD 9931
204 #endif
206 #ifndef EPROTO
207 #define EPROTO 9932
208 #endif
210 #ifndef EPROTONOSUPPORT
211 #define EPROTONOSUPPORT 9933
212 #endif
214 #ifndef ENOTRECOVERABLE
215 #define ENOTRECOVERABLE 9934
216 #endif
218 #ifndef ETIME
219 #define ETIME 9935
220 #endif
222 #ifndef ETXTBSY
223 #define ETXTBSY 9936
224 #endif
226 #ifndef ETIMEDOUT
227 #define ETIMEDOUT 9938
228 #endif
230 #ifndef ELOOP
231 #define ELOOP 9939
232 #endif
234 #ifndef EOVERFLOW
235 #define EOVERFLOW 9940
236 #endif
238 #ifndef EPROTOTYPE
239 #define EPROTOTYPE 9941
240 #endif
242 #ifndef ENOSYS
243 #define ENOSYS 9942
244 #endif
246 #ifndef EINVAL
247 #define EINVAL 9943
248 #endif
250 #ifndef ERANGE
251 #define ERANGE 9944
252 #endif
254 #ifndef EILSEQ
255 #define EILSEQ 9945
256 #endif
258 // Windows Mobile doesn't appear to define these:
260 #ifndef E2BIG
261 #define E2BIG 9946
262 #endif
264 #ifndef EDOM
265 #define EDOM 9947
266 #endif
268 #ifndef EFAULT
269 #define EFAULT 9948
270 #endif
272 #ifndef EBADF
273 #define EBADF 9949
274 #endif
276 #ifndef EPIPE
277 #define EPIPE 9950
278 #endif
280 #ifndef EXDEV
281 #define EXDEV 9951
282 #endif
284 #ifndef EBUSY
285 #define EBUSY 9952
286 #endif
288 #ifndef ENOTEMPTY
289 #define ENOTEMPTY 9953
290 #endif
292 #ifndef ENOEXEC
293 #define ENOEXEC 9954
294 #endif
296 #ifndef EEXIST
297 #define EEXIST 9955
298 #endif
300 #ifndef EFBIG
301 #define EFBIG 9956
302 #endif
304 #ifndef ENAMETOOLONG
305 #define ENAMETOOLONG 9957
306 #endif
308 #ifndef ENOTTY
309 #define ENOTTY 9958
310 #endif
312 #ifndef EINTR
313 #define EINTR 9959
314 #endif
316 #ifndef ESPIPE
317 #define ESPIPE 9960
318 #endif
320 #ifndef EIO
321 #define EIO 9961
322 #endif
324 #ifndef EISDIR
325 #define EISDIR 9962
326 #endif
328 #ifndef ECHILD
329 #define ECHILD 9963
330 #endif
332 #ifndef ENOLCK
333 #define ENOLCK 9964
334 #endif
336 #ifndef ENOSPC
337 #define ENOSPC 9965
338 #endif
340 #ifndef ENXIO
341 #define ENXIO 9966
342 #endif
344 #ifndef ENODEV
345 #define ENODEV 9967
346 #endif
348 #ifndef ENOENT
349 #define ENOENT 9968
350 #endif
352 #ifndef ESRCH
353 #define ESRCH 9969
354 #endif
356 #ifndef ENOTDIR
357 #define ENOTDIR 9970
358 #endif
360 #ifndef ENOMEM
361 #define ENOMEM 9971
362 #endif
364 #ifndef EPERM
365 #define EPERM 9972
366 #endif
368 #ifndef EACCES
369 #define EACCES 9973
370 #endif
372 #ifndef EROFS
373 #define EROFS 9974
374 #endif
376 #ifndef EDEADLK
377 #define EDEADLK 9975
378 #endif
380 #ifndef EAGAIN
381 #define EAGAIN 9976
382 #endif
384 #ifndef ENFILE
385 #define ENFILE 9977
386 #endif
388 #ifndef EMFILE
389 #define EMFILE 9978
390 #endif
392 #ifndef EMLINK
393 #define EMLINK 9979
394 #endif
396 #endif // __cplusplus
398 #endif // _LIBCPP_ERRNO_H