Use =default for skeleton copy constructor
[ACE_TAO.git] / ACE / ace / os_include / os_errno.h
blobdac78b9bf8f925c75c72c285fce7e053b641eb77
1 // -*- C++ -*-
3 //=============================================================================
4 /**
5 * @file os_errno.h
7 * system error numbers
9 * @author Don Hinton <dhinton@dresystems.com>
10 * @author This code was originally in various places including ace/OS.h.
12 //=============================================================================
14 #ifndef ACE_OS_INCLUDE_OS_ERRNO_H
15 #define ACE_OS_INCLUDE_OS_ERRNO_H
17 #include /**/ "ace/pre.h"
19 #include /**/ "ace/config-lite.h"
21 #if !defined (ACE_LACKS_PRAGMA_ONCE)
22 # pragma once
23 #endif /* ACE_LACKS_PRAGMA_ONCE */
25 #include /**/ <errno.h>
27 #if defined (ACE_VXWORKS)
28 // Needed for VxWorks to pickup errnoSet()
29 #include /**/ <errnoLib.h>
30 #endif /* ACE_VXWORKS */
32 #ifndef ACE_CUSTOM_ERRNO_BASE
33 # define ACE_CUSTOM_ERRNO_BASE 1000
34 #endif
36 // Place all additions (especially function declarations) within extern "C" {}
37 #ifdef __cplusplus
38 extern "C"
40 #endif /* __cplusplus */
42 #if defined (ACE_WIN32)
43 // error code mapping for windows
45 // VC++ 10 has these error codes defined in errno.h,
46 // this will cause different errors in ACE.
47 // So we undef these error codes if they are wrongly defined
48 # if defined (EWOULDBLOCK) && (EWOULDBLOCK != WSAEWOULDBLOCK)
49 # undef EWOULDBLOCK
50 # endif /* EWOULDBLOCK */
51 # if defined (EINPROGRESS) && (EINPROGRESS != WSAEINPROGRESS)
52 # undef EINPROGRESS
53 # endif /* EINPROGRESS */
54 # if defined (EALREADY) && (EALREADY != WSAEALREADY)
55 # undef EALREADY
56 # endif /* EALREADY */
57 # if defined (ENOTSOCK) && (ENOTSOCK != WSAENOTSOCK)
58 # undef ENOTSOCK
59 # endif /* ENOTSOCK */
60 # if defined (EDESTADDRREQ) && (EDESTADDRREQ != WSAEDESTADDRREQ)
61 # undef EDESTADDRREQ
62 # endif /* EDESTADDRREQ */
63 # if defined (EMSGSIZE) && (EMSGSIZE != WSAEMSGSIZE)
64 # undef EMSGSIZE
65 # endif /* EMSGSIZE */
66 # if defined (EPROTOTYPE) && (EPROTOTYPE != WSAEPROTOTYPE)
67 # undef EPROTOTYPE
68 # endif /* EPROTOTYPE */
69 # if defined (ENOPROTOOPT) && (ENOPROTOOPT != WSAENOPROTOOPT)
70 # undef ENOPROTOOPT
71 # endif /* ENOPROTOOPT */
72 # if defined (EPROTONOSUPPORT) && (EPROTONOSUPPORT != WSAEPROTONOSUPPORT)
73 # undef EPROTONOSUPPORT
74 # endif /* EPROTONOSUPPORT */
75 # if defined (ESOCKTNOSUPPORT) && (ESOCKTNOSUPPORT != WSAESOCKTNOSUPPORT)
76 # undef ESOCKTNOSUPPORT
77 # endif /* ESOCKTNOSUPPORT */
78 # if defined (EOPNOTSUPP) && (EOPNOTSUPP != WSAEOPNOTSUPP)
79 # undef EOPNOTSUPP
80 # endif /* EOPNOTSUPP */
81 # if defined (EPFNOSUPPORT) && (EPFNOSUPPORT != WSAEPFNOSUPPORT)
82 # undef EPFNOSUPPORT
83 # endif /* EPFNOSUPPORT */
84 # if defined (EAFNOSUPPORT) && (EAFNOSUPPORT != WSAEAFNOSUPPORT)
85 # undef EAFNOSUPPORT
86 # endif /* EAFNOSUPPORT */
87 # if defined (EADDRINUSE) && (EADDRINUSE != WSAEADDRINUSE)
88 # undef EADDRINUSE
89 # endif /* EADDRINUSE */
90 # if defined (EADDRNOTAVAIL) && (EADDRNOTAVAIL != WSAEADDRNOTAVAIL)
91 # undef EADDRNOTAVAIL
92 # endif /* EADDRNOTAVAIL */
93 # if defined (ENETDOWN) && (ENETDOWN != WSAENETDOWN)
94 # undef ENETDOWN
95 # endif /* ENETDOWN */
96 # if defined (ENETUNREACH) && (ENETUNREACH != WSAENETUNREACH)
97 # undef ENETUNREACH
98 # endif /* ENETUNREACH */
99 # if defined (ENETRESET) && (ENETRESET != WSAENETRESET)
100 # undef ENETRESET
101 # endif /* ENETRESET */
102 # if defined (ECONNABORTED) && (ECONNABORTED != WSAECONNABORTED)
103 # undef ECONNABORTED
104 # endif /* ECONNABORTED */
105 # if defined (ECONNRESET) && (ECONNRESET != WSAECONNRESET)
106 # undef ECONNRESET
107 # endif /* ECONNRESET */
108 # if defined (ENOBUFS) && (ENOBUFS != WSAENOBUFS)
109 # undef ENOBUFS
110 # endif /* ENOBUFS */
111 # if defined (EISCONN) && (EISCONN != WSAEISCONN)
112 # undef EISCONN
113 # endif /* EISCONN */
114 # if defined (ENOTCONN) && (ENOTCONN != WSAENOTCONN)
115 # undef ENOTCONN
116 # endif /* ENOTCONN */
117 # if defined (ESHUTDOWN) && (ESHUTDOWN != WSAESHUTDOWN)
118 # undef ESHUTDOWN
119 # endif /* ESHUTDOWN */
120 # if defined (ETOOMANYREFS) && (ETOOMANYREFS != WSAETOOMANYREFS)
121 # undef ETOOMANYREFS
122 # endif /* ETOOMANYREFS */
123 # if defined (ETIMEDOUT) && (ETIMEDOUT != WSAETIMEDOUT)
124 # undef ETIMEDOUT
125 # endif /* ETIMEDOUT */
126 # if defined (ECONNREFUSED) && (ECONNREFUSED != WSAECONNREFUSED)
127 # undef ECONNREFUSED
128 # endif /* ECONNREFUSED */
129 # if defined (ELOOP) && (ELOOP != WSAELOOP)
130 # undef ELOOP
131 # endif /* ELOOP */
132 //# if defined (ENAMETOOLONG) && (ENAMETOOLONG != WSAENAMETOOLONG)
133 //# undef ENAMETOOLONG
134 //# endif /* ENAMETOOLONG */
135 # if defined (EHOSTDOWN) && (EHOSTDOWN != WSAEHOSTDOWN)
136 # undef EHOSTDOWN
137 # endif /* EHOSTDOWN */
138 # if defined (EHOSTUNREACH) && (EHOSTUNREACH != WSAEHOSTUNREACH)
139 # undef EHOSTUNREACH
140 # endif /* EHOSTUNREACH */
141 //# if defined (ENOTEMPTY) && (ENOTEMPTY != WSAENOTEMPTY)
142 //# undef ENOTEMPTY
143 //# endif /* ENOTEMPTY */
144 # if defined (EPROCLIM) && (EPROCLIM != WSAEPROCLIM)
145 # undef EPROCLIM
146 # endif /* EPROCLIM */
147 # if defined (EUSERS) && (EUSERS != WSAEUSERS)
148 # undef EUSERS
149 # endif /* EUSERS */
150 # if defined (EDQUOT) && (EDQUOT != WSAEDQUOT)
151 # undef EDQUOT
152 # endif /* EDQUOT */
153 # if defined (ESTALE) && (ESTALE != WSAESTALE)
154 # undef ESTALE
155 # endif /* ESTALE */
156 # if defined (EREMOTE) && (EREMOTE != WSAEREMOTE)
157 # undef EREMOTE
158 # endif /* EREMOTE */
160 # if !defined (ETIME)
161 # define ETIME ERROR_SEM_TIMEOUT
162 # endif /* !ETIME */
163 # if !defined (EWOULDBLOCK)
164 # define EWOULDBLOCK WSAEWOULDBLOCK
165 # endif /* !EWOULDBLOCK */
166 # if !defined (EINPROGRESS)
167 # define EINPROGRESS WSAEINPROGRESS
168 # endif /* !EINPROGRESS */
169 # if !defined (EALREADY)
170 # define EALREADY WSAEALREADY
171 # endif /* !EALREADY */
172 # if !defined (ENOTSOCK)
173 # define ENOTSOCK WSAENOTSOCK
174 # endif /* !ENOTSOCK */
175 # if !defined (EDESTADDRREQ)
176 # define EDESTADDRREQ WSAEDESTADDRREQ
177 # endif /* !EDESTADDRREQ */
178 # if !defined (EMSGSIZE)
179 # define EMSGSIZE WSAEMSGSIZE
180 # endif /* !EMSGSIZE */
181 # if !defined (EPROTOTYPE)
182 # define EPROTOTYPE WSAEPROTOTYPE
183 # endif /* !EPROTOTYPE */
184 # if !defined (ENOPROTOOPT)
185 # define ENOPROTOOPT WSAENOPROTOOPT
186 # endif /* !ENOPROTOOPT */
187 # if !defined (EPROTONOSUPPORT)
188 # define EPROTONOSUPPORT WSAEPROTONOSUPPORT
189 # endif /* !EPROTONOSUPPORT */
190 # if !defined (ESOCKTNOSUPPORT)
191 # define ESOCKTNOSUPPORT WSAESOCKTNOSUPPORT
192 # endif /* !ESOCKTNOSUPPORT */
193 # if !defined (EOPNOTSUPP)
194 # define EOPNOTSUPP WSAEOPNOTSUPP
195 # endif /* !EOPNOTSUPP */
196 # if !defined (EPFNOSUPPORT)
197 # define EPFNOSUPPORT WSAEPFNOSUPPORT
198 # endif /* !EPFNOSUPPORT */
199 # if !defined (EAFNOSUPPORT)
200 # define EAFNOSUPPORT WSAEAFNOSUPPORT
201 # endif /* !EAFNOSUPPORT */
202 # if !defined (EADDRINUSE)
203 # define EADDRINUSE WSAEADDRINUSE
204 # endif /* !EADDRINUSE */
205 # if !defined (EADDRNOTAVAIL)
206 # define EADDRNOTAVAIL WSAEADDRNOTAVAIL
207 # endif /* !EADDRNOTAVAIL */
208 # if !defined (ENETDOWN)
209 # define ENETDOWN WSAENETDOWN
210 # endif /* !ENETDOWN */
211 # if !defined (ENETUNREACH)
212 # define ENETUNREACH WSAENETUNREACH
213 # endif /* !ENETUNREACH */
214 # if !defined (ENETRESET)
215 # define ENETRESET WSAENETRESET
216 # endif /* !ENETRESET */
217 # if !defined (ECONNABORTED)
218 # define ECONNABORTED WSAECONNABORTED
219 # endif /* !ECONNABORTED */
220 # if !defined (ECONNRESET)
221 # define ECONNRESET WSAECONNRESET
222 # endif /* !ECONNRESET */
223 # if !defined (ENOBUFS)
224 # define ENOBUFS WSAENOBUFS
225 # endif /* !ENOBUFS */
226 # if !defined (EISCONN)
227 # define EISCONN WSAEISCONN
228 # endif /* !EISCONN */
229 # if !defined (ENOTCONN)
230 # define ENOTCONN WSAENOTCONN
231 # endif /* !ENOTCONN */
232 # if !defined (ESHUTDOWN)
233 # define ESHUTDOWN WSAESHUTDOWN
234 # endif /* !ESHUTDOWN */
235 # if !defined (ETOOMANYREFS)
236 # define ETOOMANYREFS WSAETOOMANYREFS
237 # endif /* !ETOOMANYREFS */
238 # if !defined (ETIMEDOUT)
239 # define ETIMEDOUT WSAETIMEDOUT
240 # endif /* !ETIMEDOUT */
241 # if !defined (ECONNREFUSED)
242 # define ECONNREFUSED WSAECONNREFUSED
243 # endif /* !ECONNREFUSED */
244 # if !defined (ELOOP)
245 # define ELOOP WSAELOOP
246 # endif /* !ELOOP */
247 # if !defined (EHOSTDOWN)
248 # define EHOSTDOWN WSAEHOSTDOWN
249 # endif /* !EHOSTDOWN */
250 # if !defined (EHOSTUNREACH)
251 # define EHOSTUNREACH WSAEHOSTUNREACH
252 # endif /* !EHOSTUNREACH */
253 # if !defined (EPROCLIM)
254 # define EPROCLIM WSAEPROCLIM
255 # endif /* !EPROCLIM */
256 # if !defined (EUSERS)
257 # define EUSERS WSAEUSERS
258 # endif /* !EUSERS */
259 # if !defined (EDQUOT)
260 # define EDQUOT WSAEDQUOT
261 # endif /* !EDQUOT */
262 # if !defined (ESTALE)
263 # define ESTALE WSAESTALE
264 # endif /* !ESTALE */
265 # if !defined (EREMOTE)
266 # define EREMOTE WSAEREMOTE
267 # endif /* !EREMOTE */
269 // Grrr! ENAMETOOLONG and ENOTEMPTY are already defined by the horrible
270 // 'standard' library.
271 // #define ENAMETOOLONG WSAENAMETOOLONG
272 # if !defined (EADDRINUSE)
273 # define EADDRINUSE WSAEADDRINUSE
274 # endif /* EADDRINUSE*/
276 // CE needs this...
277 # if !defined (EPERM)
278 # define EPERM ERROR_ACCESS_DENIED
279 # endif
280 #endif /* ACE_WIN32 */
282 #if defined (ACE_HAS_H_ERRNO)
283 void herror (const char *str);
284 #endif /* ACE_HAS_H_ERRNO */
286 #if defined (ACE_DEFINE_MISSING_ERRNOS)
287 # if !defined (EPERM)
288 # define EPERM 1
289 # endif /* EPERM */
290 # if !defined (ENOENT)
291 # define ENOENT 2
292 # endif /* ENOENT */
293 # if !defined (ESRCH)
294 # define ESRCH 3
295 # endif /* ESRCH */
296 # if !defined (EINTR)
297 # define EINTR 4
298 # endif /* EINTR */
299 # if !defined (EIO)
300 # define EIO 5
301 # endif /* EIO */
302 # if !defined (ENXIO)
303 # define ENXIO 6
304 # endif /* ENXIO */
305 # if !defined (E2BIG)
306 # define E2BIG 7
307 # endif /* E2BIG */
308 # if !defined (ENOEXEC)
309 # define ENOEXEC 8
310 # endif /* ENOEXEC */
311 # if !defined (EBADF)
312 # define EBADF 9
313 # endif /* EBADF */
314 # if !defined (ECHILD)
315 # define ECHILD 10
316 # endif /* ECHILD */
317 # if !defined (EAGAIN)
318 # define EAGAIN 11
319 # endif /* EAGAIN */
320 # if !defined (ENOMEM)
321 # define ENOMEM 12
322 # endif /* ENOMEM */
323 # if !defined (EACCES)
324 # define EACCES 13
325 # endif /* EACCES */
326 # if !defined (EFAULT)
327 # define EFAULT 14
328 # endif /* EFAULT */
329 # if !defined (EBUSY)
330 # define EBUSY 16
331 # endif /* EBUSY */
332 # if !defined (EEXIST)
333 # define EEXIST 17
334 # endif /* EEXIST */
335 # if !defined (EXDEV)
336 # define EXDEV 18
337 # endif /* EXDEV */
338 # if !defined (ENODEV)
339 # define ENODEV 19
340 # endif /* ENODEV */
341 # if !defined (ENOTDIR)
342 # define ENOTDIR 20
343 # endif /* ENOTDIR */
344 # if !defined (EISDIR)
345 # define EISDIR 21
346 # endif /* EISDIR */
347 # if !defined (EINVAL)
348 # define EINVAL 22
349 # endif /* EINVAL */
350 # if !defined (ENFILE)
351 # define ENFILE 23
352 # endif /* ENFILE */
353 # if !defined (EMFILE)
354 # define EMFILE 24
355 # endif /* EMFILE */
356 # if !defined (ENOTTY)
357 # define ENOTTY 25
358 # endif /* ENOTTY */
359 # if !defined (EFBIG)
360 # define EFBIG 27
361 # endif /* EFBIG */
362 # if !defined (ENOSPC)
363 # define ENOSPC 28
364 # endif /* ENOSPC */
365 # if !defined (ESPIPE)
366 # define ESPIPE 29
367 # endif /* ESPIPE */
368 # if !defined (EROFS)
369 # define EROFS 30
370 # endif /* EROFS */
371 # if !defined (EMLINK)
372 # define EMLINK 31
373 # endif /* EMLINK */
374 # if !defined (EPIPE)
375 # define EPIPE 32
376 # endif /* EPIPE */
377 # if !defined (EDOM)
378 # define EDOM 33
379 # endif /* EDOM */
380 # if !defined (ERANGE)
381 # define ERANGE 34
382 # endif /* ERANGE */
383 # if !defined (EDEADLK) && !defined (ACE_MQX) // Conflicts with EILSEQ
384 # define EDEADLK 36
385 # endif /* EDEADLK */
386 # if !defined (ENAMETOOLONG)
387 # define ENAMETOOLONG 38
388 # endif /* ENAMETOOLONG */
389 # if !defined (ENOLCK)
390 # define ENOLCK 39
391 # endif /* ENOLCK */
392 # if !defined (ENOSYS)
393 # define ENOSYS 40
394 # endif /* ENOSYS */
395 # if !defined (ENOTEMPTY)
396 # define ENOTEMPTY 41
397 # endif /* ENOTEMPTY */
398 # ifndef ETIME
399 # define ETIME 62
400 # endif
401 # ifndef ECOMM
402 # define ECOMM 70
403 # endif
404 # ifndef EAFNOSUPPORT
405 # define EAFNOSUPPORT 97
406 # endif
407 # ifndef EADDRIUNSE
408 # define EADDRINUSE 98
409 # endif
410 # ifndef ENETUNREACH
411 # define ENETUNREACH 101
412 # endif
413 # ifndef ECONNRESET
414 # define ECONNRESET 104
415 # endif
416 # ifndef ENOBUFS
417 # define ENOBUFS 105
418 # endif
419 # ifndef EISCONN
420 # define EISCONN 106
421 # endif
422 # ifndef ECONNREFUSED
423 # define ECONNREFUSED 111
424 # endif
425 # ifndef EINPROGRESS
426 # define EINPROGRESS 115
427 # endif
429 #endif /* ACE_DEFINE_MISSING_ERRNOS */
431 #if defined (ACE_LACKS_T_ERRNO)
432 extern int t_errno;
433 #endif /* ACE_LACKS_T_ERRNO */
435 #if !defined (ENOSYS)
436 # define ENOSYS EFAULT /* Operation not supported or unknown error. */
437 #endif /* !ENOSYS */
439 #if !defined (ENOTSUP)
440 # define ENOTSUP ENOSYS /* Operation not supported. */
441 #endif /* !ENOTSUP */
443 #if !defined (ESUCCESS)
444 # define ESUCCESS 0
445 #endif /* !ESUCCESS */
447 #if !defined (EIDRM)
448 # define EIDRM 0
449 #endif /* !EIDRM */
451 #if !defined (ENFILE)
452 # define ENFILE EMFILE /* No more socket descriptors are available. */
453 #endif /* !ENFILE */
455 #if !defined (ECOMM)
456 // Not the same, but ECONNABORTED is provided on NT.
457 # define ECOMM ECONNABORTED
458 #endif /* ECOMM */
460 #if !defined (EDEADLK)
461 # define EDEADLK (ACE_CUSTOM_ERRNO_BASE) + 1
462 #endif /* !EDEADLK */
464 #if !defined (ENXIO) /* Needed in SOCK_Dgram_Mcast */
465 # define ENXIO 6
466 #endif /* ENXIO */
468 #if !defined (ETIMEDOUT) && defined (ETIME)
469 # define ETIMEDOUT ETIME
470 #endif /* ETIMEDOUT */
472 #if !defined (ETIME) && defined (ETIMEDOUT)
473 # define ETIME ETIMEDOUT
474 #endif /* ETIMED */
476 #if !defined (EBUSY)
477 # define EBUSY ETIME
478 #endif /* EBUSY */
480 #if !defined (ECANCELED)
481 # define ECANCELED 125
482 #endif /* ECANCELED */
484 #ifndef ESHUTDOWN
485 #define ESHUTDOWN ECANCELED
486 #endif
488 #ifdef ACE_MQX
489 # define EWOULDBLOCK EAGAIN
490 # define ELOOP (ACE_CUSTOM_ERRNO_BASE) + 2
491 #endif
493 #ifdef __cplusplus
495 #endif /* __cplusplus */
497 #include /**/ "ace/post.h"
498 #endif /* ACE_OS_INCLUDE_OS_ERRNO_H */