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