1 /**
2  * D header file for C99.
3  *
4  * $(C_HEADER_DESCRIPTION pubs.opengroup.org/onlinepubs/009695399/basedefs/_errno.h.html, _errno.h)
5  *
6  * Copyright: Copyright Sean Kelly 2005 - 2009.
7  * License: Distributed under the
8  *      $(LINK2 http://www.boost.org/LICENSE_1_0.txt, Boost Software License 1.0).
9  *    (See accompanying file LICENSE)
10  * Authors:   Sean Kelly, Alex Rønne Petersen
11  * Source:    https://github.com/dlang/dmd/blob/master/druntime/src/core/stdc/errno.d
12  * Standards: ISO/IEC 9899:1999 (E)
13  */
14 
15 module core.stdc.errno;
16 
17 version (OSX)
18     version = Darwin;
19 else version (iOS)
20     version = Darwin;
21 else version (TVOS)
22     version = Darwin;
23 else version (WatchOS)
24     version = Darwin;
25 
26 version (ARM)     version = ARM_Any;
27 version (AArch64) version = ARM_Any;
28 version (HPPA)    version = HPPA_Any;
29 version (MIPS32)  version = MIPS_Any;
30 version (MIPS64)  version = MIPS_Any;
31 version (PPC)     version = PPC_Any;
32 version (PPC64)   version = PPC_Any;
33 version (RISCV32) version = RISCV_Any;
34 version (RISCV64) version = RISCV_Any;
35 version (S390)    version = IBMZ_Any;
36 version (SPARC)   version = SPARC_Any;
37 version (SPARC64) version = SPARC_Any;
38 version (SystemZ) version = IBMZ_Any;
39 version (X86)     version = X86_Any;
40 version (X86_64)  version = X86_Any;
41 
42 @trusted: // Only manipulates errno.
43 nothrow:
44 @nogc:
45 
46 version (CRuntime_DigitalMars)
47 {
48     extern (C)
49     {
50         ref int _errno();
51         alias errno = _errno;
52     }
53 }
54 else version (CRuntime_Microsoft)
55 {
56     extern (C)
57     {
58         ref int _errno();
59         alias errno = _errno;
60     }
61 }
62 else version (CRuntime_Glibc)
63 {
64     extern (C)
65     {
66         ref int __errno_location();
67         alias errno = __errno_location;
68     }
69 }
70 else version (CRuntime_Musl)
71 {
72     extern (C)
73     {
74         ref int __errno_location();
75         alias errno = __errno_location;
76     }
77 }
78 else version (OpenBSD)
79 {
80     // https://github.com/openbsd/src/blob/master/include/errno.h
81     extern (C)
82     {
83         ref int __errno();
84         alias errno = __errno;
85     }
86 }
87 else version (NetBSD)
88 {
89     // https://github.com/NetBSD/src/blob/trunk/include/errno.h
90     extern (C)
91     {
92         ref int __errno();
93         alias errno = __errno;
94     }
95 }
96 else version (FreeBSD)
97 {
98     extern (C)
99     {
100         ref int __error();
101         alias errno = __error;
102     }
103 }
104 else version (DragonFlyBSD)
105 {
106     extern (C)
107     {
108         pragma(mangle, "errno") int __errno;
109         ref int __error() {
110             return __errno;
111         }
112         alias errno = __error;
113     }
114 }
115 else version (CRuntime_Bionic)
116 {
117     extern (C)
118     {
119         ref int __errno();
120         alias errno = __errno;
121     }
122 }
123 else version (CRuntime_UClibc)
124 {
125     extern (C)
126     {
127         ref int __errno_location();
128         alias errno = __errno_location;
129     }
130 }
131 else version (Darwin)
132 {
133     extern (C)
134     {
135         ref int __error();
136         alias errno = __error;
137     }
138 }
139 else version (Solaris)
140 {
141     extern (C)
142     {
143         ref int ___errno();
144         alias errno = ___errno;
145     }
146 }
147 else version (Haiku)
148 {
149     // https://github.com/haiku/haiku/blob/master/headers/posix/errno.h
150     extern (C)
151     {
152         ref int _errnop();
153         alias errno = _errnop;
154     }
155 }
156 else
157 {
158     ///
159     extern(C) pragma(mangle, "getErrno") @property int errno();
160     ///
161     extern(C) pragma(mangle, "setErrno") @property int errno(int n);
162 }
163 
164 extern (C):
165 
166 
167 version (Windows)
168 {
169     enum EPERM              = 1;        /// Operation not permitted
170     enum ENOENT             = 2;        /// No such file or directory
171     enum ESRCH              = 3;        /// No such process
172     enum EINTR              = 4;        /// Interrupted system call
173     enum EIO                = 5;        /// I/O error
174     enum ENXIO              = 6;        /// No such device or address
175     enum E2BIG              = 7;        /// Argument list too long
176     enum ENOEXEC            = 8;        /// Exec format error
177     enum EBADF              = 9;        /// Bad file number
178     enum ECHILD             = 10;       /// No child processes
179     enum EAGAIN             = 11;       /// Try again
180     enum ENOMEM             = 12;       /// Out of memory
181     enum EACCES             = 13;       /// Permission denied
182     enum EFAULT             = 14;       /// Bad address
183     enum EBUSY              = 16;       /// Device or resource busy
184     enum EEXIST             = 17;       /// File exists
185     enum EXDEV              = 18;       /// Cross-device link
186     enum ENODEV             = 19;       /// No such device
187     enum ENOTDIR            = 20;       /// Not a directory
188     enum EISDIR             = 21;       /// Is a directory
189     enum EINVAL             = 22;       /// Invalid argument
190     enum ENFILE             = 23;       /// File table overflow
191     enum EMFILE             = 24;       /// Too many open files
192     enum ENOTTY             = 25;       /// Not a typewriter
193     enum EFBIG              = 27;       /// File too large
194     enum ENOSPC             = 28;       /// No space left on device
195     enum ESPIPE             = 29;       /// Illegal seek
196     enum EROFS              = 30;       /// Read-only file system
197     enum EMLINK             = 31;       /// Too many links
198     enum EPIPE              = 32;       /// Broken pipe
199     enum EDOM               = 33;       /// Math argument out of domain of func
200     enum ERANGE             = 34;       /// Math result not representable
201     enum EDEADLK            = 36;       /// Resource deadlock would occur
202     enum ENAMETOOLONG       = 38;       /// File name too long
203     enum ENOLCK             = 39;       /// No record locks available
204     enum ENOSYS             = 40;       /// Function not implemented
205     enum ENOTEMPTY          = 41;       /// Directory not empty
206     enum EILSEQ             = 42;       /// Illegal byte sequence
207     enum EDEADLOCK          = EDEADLK;  /// Resource deadlock would occur
208 
209     // POSIX compatibility
210     // See_Also: https://docs.microsoft.com/en-us/cpp/c-runtime-library/errno-constants
211     enum EADDRINUSE         = 100;
212     enum EADDRNOTAVAIL      = 101;
213     enum EAFNOSUPPORT       = 102;
214     enum EALREADY           = 103;
215     enum EBADMSG            = 104;
216     enum ECANCELED          = 105;
217     enum ECONNABORTED       = 106;
218     enum ECONNREFUSED       = 107;
219     enum ECONNRESET         = 108;
220     enum EDESTADDRREQ       = 109;
221     enum EHOSTUNREACH       = 110;
222     enum EIDRM              = 111;
223     enum EINPROGRESS        = 112;
224     enum EISCONN            = 113;
225     enum ELOOP              = 114;
226     enum EMSGSIZE           = 115;
227     enum ENETDOWN           = 116;
228     enum ENETRESET          = 117;
229     enum ENETUNREACH        = 118;
230     enum ENOBUFS            = 119;
231     enum ENODATA            = 120;
232     enum ENOLINK            = 121;
233     enum ENOMSG             = 122;
234     enum ENOPROTOOPT        = 123;
235     enum ENOSR              = 124;
236     enum ENOSTR             = 125;
237     enum ENOTCONN           = 126;
238     enum ENOTRECOVERABLE    = 127;
239     enum ENOTSOCK           = 128;
240     enum ENOTSUP            = 129;
241     enum EOPNOTSUPP         = 130;
242     enum EOTHER             = 131;
243     enum EOVERFLOW          = 132;
244     enum EOWNERDEAD         = 133;
245     enum EPROTO             = 134;
246     enum EPROTONOSUPPORT    = 135;
247     enum EPROTOTYPE         = 136;
248     enum ETIME              = 137;
249     enum ETIMEDOUT          = 138;
250     enum ETXTBSY            = 139;
251     enum EWOULDBLOCK        = 140;
252 }
253 else version (linux)
254 {
255     enum EPERM              = 1;  ///
256     enum ENOENT             = 2;  ///
257     enum ESRCH              = 3;  ///
258     enum EINTR              = 4;  ///
259     enum EIO                = 5;  ///
260     enum ENXIO              = 6;  ///
261     enum E2BIG              = 7;  ///
262     enum ENOEXEC            = 8;  ///
263     enum EBADF              = 9;  ///
264     enum ECHILD             = 10; ///
265     enum EAGAIN             = 11; ///
266     enum ENOMEM             = 12; ///
267     enum EACCES             = 13; ///
268     enum EFAULT             = 14; ///
269     enum ENOTBLK            = 15; ///
270     enum EBUSY              = 16; ///
271     enum EEXIST             = 17; ///
272     enum EXDEV              = 18; ///
273     enum ENODEV             = 19; ///
274     enum ENOTDIR            = 20; ///
275     enum EISDIR             = 21; ///
276     enum EINVAL             = 22; ///
277     enum ENFILE             = 23; ///
278     enum EMFILE             = 24; ///
279     enum ENOTTY             = 25; ///
280     enum ETXTBSY            = 26; ///
281     enum EFBIG              = 27; ///
282     enum ENOSPC             = 28; ///
283     enum ESPIPE             = 29; ///
284     enum EROFS              = 30; ///
285     enum EMLINK             = 31; ///
286     enum EPIPE              = 32; ///
287     enum EDOM               = 33; ///
288     enum ERANGE             = 34; ///
289 
290     version (X86_Any)
291     {
292         enum EDEADLK            = 35;         ///
293         enum ENAMETOOLONG       = 36;         ///
294         enum ENOLCK             = 37;         ///
295         enum ENOSYS             = 38;         ///
296         enum ENOTEMPTY          = 39;         ///
297         enum ELOOP              = 40;         ///
298         enum EWOULDBLOCK        = EAGAIN;     ///
299         enum ENOMSG             = 42;         ///
300         enum EIDRM              = 43;         ///
301         enum ECHRNG             = 44;         ///
302         enum EL2NSYNC           = 45;         ///
303         enum EL3HLT             = 46;         ///
304         enum EL3RST             = 47;         ///
305         enum ELNRNG             = 48;         ///
306         enum EUNATCH            = 49;         ///
307         enum ENOCSI             = 50;         ///
308         enum EL2HLT             = 51;         ///
309         enum EBADE              = 52;         ///
310         enum EBADR              = 53;         ///
311         enum EXFULL             = 54;         ///
312         enum ENOANO             = 55;         ///
313         enum EBADRQC            = 56;         ///
314         enum EBADSLT            = 57;         ///
315         enum EDEADLOCK          = EDEADLK;    ///
316         enum EBFONT             = 59;         ///
317         enum ENOSTR             = 60;         ///
318         enum ENODATA            = 61;         ///
319         enum ETIME              = 62;         ///
320         enum ENOSR              = 63;         ///
321         enum ENONET             = 64;         ///
322         enum ENOPKG             = 65;         ///
323         enum EREMOTE            = 66;         ///
324         enum ENOLINK            = 67;         ///
325         enum EADV               = 68;         ///
326         enum ESRMNT             = 69;         ///
327         enum ECOMM              = 70;         ///
328         enum EPROTO             = 71;         ///
329         enum EMULTIHOP          = 72;         ///
330         enum EDOTDOT            = 73;         ///
331         enum EBADMSG            = 74;         ///
332         enum EOVERFLOW          = 75;         ///
333         enum ENOTUNIQ           = 76;         ///
334         enum EBADFD             = 77;         ///
335         enum EREMCHG            = 78;         ///
336         enum ELIBACC            = 79;         ///
337         enum ELIBBAD            = 80;         ///
338         enum ELIBSCN            = 81;         ///
339         enum ELIBMAX            = 82;         ///
340         enum ELIBEXEC           = 83;         ///
341         enum EILSEQ             = 84;         ///
342         enum ERESTART           = 85;         ///
343         enum ESTRPIPE           = 86;         ///
344         enum EUSERS             = 87;         ///
345         enum ENOTSOCK           = 88;         ///
346         enum EDESTADDRREQ       = 89;         ///
347         enum EMSGSIZE           = 90;         ///
348         enum EPROTOTYPE         = 91;         ///
349         enum ENOPROTOOPT        = 92;         ///
350         enum EPROTONOSUPPORT    = 93;         ///
351         enum ESOCKTNOSUPPORT    = 94;         ///
352         enum EOPNOTSUPP         = 95;         ///
353         enum ENOTSUP            = EOPNOTSUPP; ///
354         enum EPFNOSUPPORT       = 96;         ///
355         enum EAFNOSUPPORT       = 97;         ///
356         enum EADDRINUSE         = 98;         ///
357         enum EADDRNOTAVAIL      = 99;         ///
358         enum ENETDOWN           = 100;        ///
359         enum ENETUNREACH        = 101;        ///
360         enum ENETRESET          = 102;        ///
361         enum ECONNABORTED       = 103;        ///
362         enum ECONNRESET         = 104;        ///
363         enum ENOBUFS            = 105;        ///
364         enum EISCONN            = 106;        ///
365         enum ENOTCONN           = 107;        ///
366         enum ESHUTDOWN          = 108;        ///
367         enum ETOOMANYREFS       = 109;        ///
368         enum ETIMEDOUT          = 110;        ///
369         enum ECONNREFUSED       = 111;        ///
370         enum EHOSTDOWN          = 112;        ///
371         enum EHOSTUNREACH       = 113;        ///
372         enum EALREADY           = 114;        ///
373         enum EINPROGRESS        = 115;        ///
374         enum ESTALE             = 116;        ///
375         enum EUCLEAN            = 117;        ///
376         enum ENOTNAM            = 118;        ///
377         enum ENAVAIL            = 119;        ///
378         enum EISNAM             = 120;        ///
379         enum EREMOTEIO          = 121;        ///
380         enum EDQUOT             = 122;        ///
381         enum ENOMEDIUM          = 123;        ///
382         enum EMEDIUMTYPE        = 124;        ///
383         enum ECANCELED          = 125;        ///
384         enum ENOKEY             = 126;        ///
385         enum EKEYEXPIRED        = 127;        ///
386         enum EKEYREVOKED        = 128;        ///
387         enum EKEYREJECTED       = 129;        ///
388         enum EOWNERDEAD         = 130;        ///
389         enum ENOTRECOVERABLE    = 131;        ///
390         enum ERFKILL            = 132;        ///
391         enum EHWPOISON          = 133;        ///
392     }
393     else version (ARM_Any)
394     {
395         enum EDEADLK            = 35;         ///
396         enum ENAMETOOLONG       = 36;         ///
397         enum ENOLCK             = 37;         ///
398         enum ENOSYS             = 38;         ///
399         enum ENOTEMPTY          = 39;         ///
400         enum ELOOP              = 40;         ///
401         enum EWOULDBLOCK        = EAGAIN;     ///
402         enum ENOMSG             = 42;         ///
403         enum EIDRM              = 43;         ///
404         enum ECHRNG             = 44;         ///
405         enum EL2NSYNC           = 45;         ///
406         enum EL3HLT             = 46;         ///
407         enum EL3RST             = 47;         ///
408         enum ELNRNG             = 48;         ///
409         enum EUNATCH            = 49;         ///
410         enum ENOCSI             = 50;         ///
411         enum EL2HLT             = 51;         ///
412         enum EBADE              = 52;         ///
413         enum EBADR              = 53;         ///
414         enum EXFULL             = 54;         ///
415         enum ENOANO             = 55;         ///
416         enum EBADRQC            = 56;         ///
417         enum EBADSLT            = 57;         ///
418         enum EDEADLOCK          = EDEADLK;    ///
419         enum EBFONT             = 59;         ///
420         enum ENOSTR             = 60;         ///
421         enum ENODATA            = 61;         ///
422         enum ETIME              = 62;         ///
423         enum ENOSR              = 63;         ///
424         enum ENONET             = 64;         ///
425         enum ENOPKG             = 65;         ///
426         enum EREMOTE            = 66;         ///
427         enum ENOLINK            = 67;         ///
428         enum EADV               = 68;         ///
429         enum ESRMNT             = 69;         ///
430         enum ECOMM              = 70;         ///
431         enum EPROTO             = 71;         ///
432         enum EMULTIHOP          = 72;         ///
433         enum EDOTDOT            = 73;         ///
434         enum EBADMSG            = 74;         ///
435         enum EOVERFLOW          = 75;         ///
436         enum ENOTUNIQ           = 76;         ///
437         enum EBADFD             = 77;         ///
438         enum EREMCHG            = 78;         ///
439         enum ELIBACC            = 79;         ///
440         enum ELIBBAD            = 80;         ///
441         enum ELIBSCN            = 81;         ///
442         enum ELIBMAX            = 82;         ///
443         enum ELIBEXEC           = 83;         ///
444         enum EILSEQ             = 84;         ///
445         enum ERESTART           = 85;         ///
446         enum ESTRPIPE           = 86;         ///
447         enum EUSERS             = 87;         ///
448         enum ENOTSOCK           = 88;         ///
449         enum EDESTADDRREQ       = 89;         ///
450         enum EMSGSIZE           = 90;         ///
451         enum EPROTOTYPE         = 91;         ///
452         enum ENOPROTOOPT        = 92;         ///
453         enum EPROTONOSUPPORT    = 93;         ///
454         enum ESOCKTNOSUPPORT    = 94;         ///
455         enum EOPNOTSUPP         = 95;         ///
456         enum ENOTSUP            = EOPNOTSUPP; ///
457         enum EPFNOSUPPORT       = 96;         ///
458         enum EAFNOSUPPORT       = 97;         ///
459         enum EADDRINUSE         = 98;         ///
460         enum EADDRNOTAVAIL      = 99;         ///
461         enum ENETDOWN           = 100;        ///
462         enum ENETUNREACH        = 101;        ///
463         enum ENETRESET          = 102;        ///
464         enum ECONNABORTED       = 103;        ///
465         enum ECONNRESET         = 104;        ///
466         enum ENOBUFS            = 105;        ///
467         enum EISCONN            = 106;        ///
468         enum ENOTCONN           = 107;        ///
469         enum ESHUTDOWN          = 108;        ///
470         enum ETOOMANYREFS       = 109;        ///
471         enum ETIMEDOUT          = 110;        ///
472         enum ECONNREFUSED       = 111;        ///
473         enum EHOSTDOWN          = 112;        ///
474         enum EHOSTUNREACH       = 113;        ///
475         enum EALREADY           = 114;        ///
476         enum EINPROGRESS        = 115;        ///
477         enum ESTALE             = 116;        ///
478         enum EUCLEAN            = 117;        ///
479         enum ENOTNAM            = 118;        ///
480         enum ENAVAIL            = 119;        ///
481         enum EISNAM             = 120;        ///
482         enum EREMOTEIO          = 121;        ///
483         enum EDQUOT             = 122;        ///
484         enum ENOMEDIUM          = 123;        ///
485         enum EMEDIUMTYPE        = 124;        ///
486         enum ECANCELED          = 125;        ///
487         enum ENOKEY             = 126;        ///
488         enum EKEYEXPIRED        = 127;        ///
489         enum EKEYREVOKED        = 128;        ///
490         enum EKEYREJECTED       = 129;        ///
491         enum EOWNERDEAD         = 130;        ///
492         enum ENOTRECOVERABLE    = 131;        ///
493         enum ERFKILL            = 132;        ///
494         enum EHWPOISON          = 133;        ///
495     }
496     else version (HPPA_Any)
497     {
498         enum ENOMSG             = 35;         ///
499         enum EIDRM              = 36;         ///
500         enum ECHRNG             = 37;         ///
501         enum EL2NSYNC           = 38;         ///
502         enum EL3HLT             = 39;         ///
503         enum EL3RST             = 40;         ///
504         enum ELNRNG             = 41;         ///
505         enum EUNATCH            = 42;         ///
506         enum ENOCSI             = 43;         ///
507         enum EL2HLT             = 44;         ///
508         enum EDEADLK            = 45;         ///
509         enum EDEADLOCK          = EDEADLK;    ///
510         enum ENOLCK             = 46;         ///
511         enum EILSEQ             = 47;         ///
512         enum ENONET             = 50;         ///
513         enum ENODATA            = 51;         ///
514         enum ETIME              = 52;         ///
515         enum ENOSR              = 53;         ///
516         enum ENOSTR             = 54;         ///
517         enum ENOPKG             = 55;         ///
518         enum ENOLINK            = 57;         ///
519         enum EADV               = 58;         ///
520         enum ESRMNT             = 59;         ///
521         enum ECOMM              = 60;         ///
522         enum EPROTO             = 61;         ///
523         enum EMULTIHOP          = 64;         ///
524         enum EDOTDOT            = 66;         ///
525         enum EBADMSG            = 67;         ///
526         enum EUSERS             = 68;         ///
527         enum EDQUOT             = 69;         ///
528         enum ESTALE             = 70;         ///
529         enum EREMOTE            = 71;         ///
530         enum EOVERFLOW          = 72;         ///
531         enum EBADE              = 160;        ///
532         enum EBADR              = 161;        ///
533         enum EXFULL             = 162;        ///
534         enum ENOANO             = 163;        ///
535         enum EBADRQC            = 164;        ///
536         enum EBADSLT            = 165;        ///
537         enum EBFONT             = 166;        ///
538         enum ENOTUNIQ           = 167;        ///
539         enum EBADFD             = 168;        ///
540         enum EREMCHG            = 169;        ///
541         enum ELIBACC            = 170;        ///
542         enum ELIBBAD            = 171;        ///
543         enum ELIBSCN            = 172;        ///
544         enum ELIBMAX            = 173;        ///
545         enum ELIBEXEC           = 174;        ///
546         enum ERESTART           = 175;        ///
547         enum ESTRPIPE           = 176;        ///
548         enum EUCLEAN            = 177;        ///
549         enum ENOTNAM            = 178;        ///
550         enum ENAVAIL            = 179;        ///
551         enum EISNAM             = 180;        ///
552         enum EREMOTEIO          = 181;        ///
553         enum ENOMEDIUM          = 182;        ///
554         enum EMEDIUMTYPE        = 183;        ///
555         enum ENOKEY             = 184;        ///
556         enum EKEYEXPIRED        = 185;        ///
557         enum EKEYREVOKED        = 186;        ///
558         enum EKEYREJECTED       = 187;        ///
559         enum ENOSYM             = 215;        ///
560         enum ENOTSOCK           = 216;        ///
561         enum EDESTADDRREQ       = 217;        ///
562         enum EMSGSIZE           = 218;        ///
563         enum EPROTOTYPE         = 219;        ///
564         enum ENOPROTOOPT        = 220;        ///
565         enum EPROTONOSUPPORT    = 221;        ///
566         enum ESOCKTNOSUPPORT    = 221;        ///
567         enum EOPNOTSUPP         = 223;        ///
568         enum EPFNOSUPPORT       = 224;        ///
569         enum EAFNOSUPPORT       = 225;        ///
570         enum EADDRINUSE         = 226;        ///
571         enum EADDRNOTAVAIL      = 227;        ///
572         enum ENETDOWN           = 228;        ///
573         enum ENETUNREACH        = 229;        ///
574         enum ENETRESET          = 230;        ///
575         enum ECONNABORTED       = 231;        ///
576         enum ECONNRESET         = 232;        ///
577         enum ENOBUFS            = 233;        ///
578         enum EISCONN            = 234;        ///
579         enum ENOTCONN           = 235;        ///
580         enum ESHUTDOWN          = 236;        ///
581         enum ETOOMANYREFS       = 237;        ///
582         enum ETIMEDOUT          = 238;        ///
583         enum ECONNREFUSED       = 239;        ///
584         enum EREFUSED           = ECONNREFUSED; ///
585         enum EREMOTERELEASE     = 240;        ///
586         enum EHOSTDOWN          = 241;        ///
587         enum EHOSTUNREACH       = 242;        ///
588         enum EALREADY           = 244;        ///
589         enum EINPROGRESS        = 245;        ///
590         enum EWOULDBLOCK        = EAGAIN;     ///
591         enum ENOTEMPTY          = 247;        ///
592         enum ENAMETOOLONG       = 248;        ///
593         enum ELOOP              = 249;        ///
594         enum ENOSYS             = 251;        ///
595         enum ECANCELLED         = 253;        ///
596         enum ECANCELED          = ECANCELLED;  ///
597         enum EOWNERDEAD         = 254;        ///
598         enum ENOTRECOVERABLE    = 255;        ///
599         enum ERFKILL            = 256;        ///
600         enum EHWPOISON          = 257;        ///
601     }
602     else version (MIPS_Any)
603     {
604         enum ENOMSG             = 35;         ///
605         enum EIDRM              = 36;         ///
606         enum ECHRNG             = 37;         ///
607         enum EL2NSYNC           = 38;         ///
608         enum EL3HLT             = 39;         ///
609         enum EL3RST             = 40;         ///
610         enum ELNRNG             = 41;         ///
611         enum EUNATCH            = 42;         ///
612         enum ENOCSI             = 43;         ///
613         enum EL2HLT             = 44;         ///
614         enum EDEADLK            = 45;         ///
615         enum ENOLCK             = 46;         ///
616         enum EBADE              = 50;         ///
617         enum EBADR              = 51;         ///
618         enum EXFULL             = 52;         ///
619         enum ENOANO             = 53;         ///
620         enum EBADRQC            = 54;         ///
621         enum EBADSLT            = 55;         ///
622         enum EDEADLOCK          = 56;         ///
623         enum EBFONT             = 59;         ///
624         enum ENOSTR             = 60;         ///
625         enum ENODATA            = 61;         ///
626         enum ETIME              = 62;         ///
627         enum ENOSR              = 63;         ///
628         enum ENONET             = 64;         ///
629         enum ENOPKG             = 65;         ///
630         enum EREMOTE            = 66;         ///
631         enum ENOLINK            = 67;         ///
632         enum EADV               = 68;         ///
633         enum ESRMNT             = 69;         ///
634         enum ECOMM              = 70;         ///
635         enum EPROTO             = 71;         ///
636         enum EDOTDOT            = 73;         ///
637         enum EMULTIHOP          = 74;         ///
638         enum EBADMSG            = 77;         ///
639         enum ENAMETOOLONG       = 78;         ///
640         enum EOVERFLOW          = 79;         ///
641         enum ENOTUNIQ           = 80;         ///
642         enum EBADFD             = 81;         ///
643         enum EREMCHG            = 82;         ///
644         enum ELIBACC            = 83;         ///
645         enum ELIBBAD            = 84;         ///
646         enum ELIBSCN            = 85;         ///
647         enum ELIBMAX            = 86;         ///
648         enum ELIBEXEC           = 87;         ///
649         enum EILSEQ             = 88;         ///
650         enum ENOSYS             = 89;         ///
651         enum ELOOP              = 90;         ///
652         enum ERESTART           = 91;         ///
653         enum ESTRPIPE           = 92;         ///
654         enum ENOTEMPTY          = 93;         ///
655         enum EUSERS             = 94;         ///
656         enum ENOTSOCK           = 95;         ///
657         enum EDESTADDRREQ       = 96;         ///
658         enum EMSGSIZE           = 97;         ///
659         enum EPROTOTYPE         = 98;         ///
660         enum ENOPROTOOPT        = 99;         ///
661         enum EPROTONOSUPPORT    = 120;        ///
662         enum ESOCKTNOSUPPORT    = 121;        ///
663         enum EOPNOTSUPP         = 122;        ///
664         enum ENOTSUP            = EOPNOTSUPP; ///
665         enum EPFNOSUPPORT       = 123;        ///
666         enum EAFNOSUPPORT       = 124;        ///
667         enum EADDRINUSE         = 125;        ///
668         enum EADDRNOTAVAIL      = 126;        ///
669         enum ENETDOWN           = 127;        ///
670         enum ENETUNREACH        = 128;        ///
671         enum ENETRESET          = 129;        ///
672         enum ECONNABORTED       = 130;        ///
673         enum ECONNRESET         = 131;        ///
674         enum ENOBUFS            = 132;        ///
675         enum EISCONN            = 133;        ///
676         enum ENOTCONN           = 134;        ///
677         enum EUCLEAN            = 135;        ///
678         enum ENOTNAM            = 137;        ///
679         enum ENAVAIL            = 138;        ///
680         enum EISNAM             = 139;        ///
681         enum EREMOTEIO          = 140;        ///
682         enum EINIT              = 141;        ///
683         enum EREMDEV            = 142;        ///
684         enum ESHUTDOWN          = 143;        ///
685         enum ETOOMANYREFS       = 144;        ///
686         enum ETIMEDOUT          = 145;        ///
687         enum ECONNREFUSED       = 146;        ///
688         enum EHOSTDOWN          = 147;        ///
689         enum EHOSTUNREACH       = 148;        ///
690         enum EWOULDBLOCK        = EAGAIN;     ///
691         enum EALREADY           = 149;        ///
692         enum EINPROGRESS        = 150;        ///
693         enum ESTALE             = 151;        ///
694         enum ECANCELED          = 158;        ///
695         enum ENOMEDIUM          = 159;        ///
696         enum EMEDIUMTYPE        = 160;        ///
697         enum ENOKEY             = 161;        ///
698         enum EKEYEXPIRED        = 162;        ///
699         enum EKEYREVOKED        = 163;        ///
700         enum EKEYREJECTED       = 164;        ///
701         enum EOWNERDEAD         = 165;        ///
702         enum ENOTRECOVERABLE    = 166;        ///
703         enum ERFKILL            = 167;        ///
704         enum EHWPOISON          = 168;        ///
705         enum EDQUOT             = 1133;       ///
706     }
707     else version (PPC_Any)
708     {
709         enum EDEADLK            = 35;         ///
710         enum ENAMETOOLONG       = 36;         ///
711         enum ENOLCK             = 37;         ///
712         enum ENOSYS             = 38;         ///
713         enum ENOTEMPTY          = 39;         ///
714         enum ELOOP              = 40;         ///
715         enum EWOULDBLOCK        = EAGAIN;     ///
716         enum ENOMSG             = 42;         ///
717         enum EIDRM              = 43;         ///
718         enum ECHRNG             = 44;         ///
719         enum EL2NSYNC           = 45;         ///
720         enum EL3HLT             = 46;         ///
721         enum EL3RST             = 47;         ///
722         enum ELNRNG             = 48;         ///
723         enum EUNATCH            = 49;         ///
724         enum ENOCSI             = 50;         ///
725         enum EL2HLT             = 51;         ///
726         enum EBADE              = 52;         ///
727         enum EBADR              = 53;         ///
728         enum EXFULL             = 54;         ///
729         enum ENOANO             = 55;         ///
730         enum EBADRQC            = 56;         ///
731         enum EBADSLT            = 57;         ///
732         enum EDEADLOCK          = 58;         ///
733         enum EBFONT             = 59;         ///
734         enum ENOSTR             = 60;         ///
735         enum ENODATA            = 61;         ///
736         enum ETIME              = 62;         ///
737         enum ENOSR              = 63;         ///
738         enum ENONET             = 64;         ///
739         enum ENOPKG             = 65;         ///
740         enum EREMOTE            = 66;         ///
741         enum ENOLINK            = 67;         ///
742         enum EADV               = 68;         ///
743         enum ESRMNT             = 69;         ///
744         enum ECOMM              = 70;         ///
745         enum EPROTO             = 71;         ///
746         enum EMULTIHOP          = 72;         ///
747         enum EDOTDOT            = 73;         ///
748         enum EBADMSG            = 74;         ///
749         enum EOVERFLOW          = 75;         ///
750         enum ENOTUNIQ           = 76;         ///
751         enum EBADFD             = 77;         ///
752         enum EREMCHG            = 78;         ///
753         enum ELIBACC            = 79;         ///
754         enum ELIBBAD            = 80;         ///
755         enum ELIBSCN            = 81;         ///
756         enum ELIBMAX            = 82;         ///
757         enum ELIBEXEC           = 83;         ///
758         enum EILSEQ             = 84;         ///
759         enum ERESTART           = 85;         ///
760         enum ESTRPIPE           = 86;         ///
761         enum EUSERS             = 87;         ///
762         enum ENOTSOCK           = 88;         ///
763         enum EDESTADDRREQ       = 89;         ///
764         enum EMSGSIZE           = 90;         ///
765         enum EPROTOTYPE         = 91;         ///
766         enum ENOPROTOOPT        = 92;         ///
767         enum EPROTONOSUPPORT    = 93;         ///
768         enum ESOCKTNOSUPPORT    = 94;         ///
769         enum EOPNOTSUPP         = 95;         ///
770         enum ENOTSUP            = EOPNOTSUPP; ///
771         enum EPFNOSUPPORT       = 96;         ///
772         enum EAFNOSUPPORT       = 97;         ///
773         enum EADDRINUSE         = 98;         ///
774         enum EADDRNOTAVAIL      = 99;         ///
775         enum ENETDOWN           = 100;        ///
776         enum ENETUNREACH        = 101;        ///
777         enum ENETRESET          = 102;        ///
778         enum ECONNABORTED       = 103;        ///
779         enum ECONNRESET         = 104;        ///
780         enum ENOBUFS            = 105;        ///
781         enum EISCONN            = 106;        ///
782         enum ENOTCONN           = 107;        ///
783         enum ESHUTDOWN          = 108;        ///
784         enum ETOOMANYREFS       = 109;        ///
785         enum ETIMEDOUT          = 110;        ///
786         enum ECONNREFUSED       = 111;        ///
787         enum EHOSTDOWN          = 112;        ///
788         enum EHOSTUNREACH       = 113;        ///
789         enum EALREADY           = 114;        ///
790         enum EINPROGRESS        = 115;        ///
791         enum ESTALE             = 116;        ///
792         enum EUCLEAN            = 117;        ///
793         enum ENOTNAM            = 118;        ///
794         enum ENAVAIL            = 119;        ///
795         enum EISNAM             = 120;        ///
796         enum EREMOTEIO          = 121;        ///
797         enum EDQUOT             = 122;        ///
798         enum ENOMEDIUM          = 123;        ///
799         enum EMEDIUMTYPE        = 124;        ///
800         enum ECANCELED          = 125;        ///
801         enum ENOKEY             = 126;        ///
802         enum EKEYEXPIRED        = 127;        ///
803         enum EKEYREVOKED        = 128;        ///
804         enum EKEYREJECTED       = 129;        ///
805         enum EOWNERDEAD         = 130;        ///
806         enum ENOTRECOVERABLE    = 131;        ///
807         enum ERFKILL            = 132;        ///
808         enum EHWPOISON          = 133;        ///
809     }
810     else version (RISCV_Any)
811     {
812         enum EDEADLK            = 35;         ///
813         enum ENAMETOOLONG       = 36;         ///
814         enum ENOLCK             = 37;         ///
815         enum ENOSYS             = 38;         ///
816         enum ENOTEMPTY          = 39;         ///
817         enum ELOOP              = 40;         ///
818         enum EWOULDBLOCK        = EAGAIN;     ///
819         enum ENOMSG             = 42;         ///
820         enum EIDRM              = 43;         ///
821         enum ECHRNG             = 44;         ///
822         enum EL2NSYNC           = 45;         ///
823         enum EL3HLT             = 46;         ///
824         enum EL3RST             = 47;         ///
825         enum ELNRNG             = 48;         ///
826         enum EUNATCH            = 49;         ///
827         enum ENOCSI             = 50;         ///
828         enum EL2HLT             = 51;         ///
829         enum EBADE              = 52;         ///
830         enum EBADR              = 53;         ///
831         enum EXFULL             = 54;         ///
832         enum ENOANO             = 55;         ///
833         enum EBADRQC            = 56;         ///
834         enum EBADSLT            = 57;         ///
835         enum EDEADLOCK          = EDEADLK;    ///
836         enum EBFONT             = 59;         ///
837         enum ENOSTR             = 60;         ///
838         enum ENODATA            = 61;         ///
839         enum ETIME              = 62;         ///
840         enum ENOSR              = 63;         ///
841         enum ENONET             = 64;         ///
842         enum ENOPKG             = 65;         ///
843         enum EREMOTE            = 66;         ///
844         enum ENOLINK            = 67;         ///
845         enum EADV               = 68;         ///
846         enum ESRMNT             = 69;         ///
847         enum ECOMM              = 70;         ///
848         enum EPROTO             = 71;         ///
849         enum EMULTIHOP          = 72;         ///
850         enum EDOTDOT            = 73;         ///
851         enum EBADMSG            = 74;         ///
852         enum EOVERFLOW          = 75;         ///
853         enum ENOTUNIQ           = 76;         ///
854         enum EBADFD             = 77;         ///
855         enum EREMCHG            = 78;         ///
856         enum ELIBACC            = 79;         ///
857         enum ELIBBAD            = 80;         ///
858         enum ELIBSCN            = 81;         ///
859         enum ELIBMAX            = 82;         ///
860         enum ELIBEXEC           = 83;         ///
861         enum EILSEQ             = 84;         ///
862         enum ERESTART           = 85;         ///
863         enum ESTRPIPE           = 86;         ///
864         enum EUSERS             = 87;         ///
865         enum ENOTSOCK           = 88;         ///
866         enum EDESTADDRREQ       = 89;         ///
867         enum EMSGSIZE           = 90;         ///
868         enum EPROTOTYPE         = 91;         ///
869         enum ENOPROTOOPT        = 92;         ///
870         enum EPROTONOSUPPORT    = 93;         ///
871         enum ESOCKTNOSUPPORT    = 94;         ///
872         enum EOPNOTSUPP         = 95;         ///
873         enum EPFNOSUPPORT       = 96;         ///
874         enum EAFNOSUPPORT       = 97;         ///
875         enum EADDRINUSE         = 98;         ///
876         enum EADDRNOTAVAIL      = 99;         ///
877         enum ENETDOWN           = 100;        ///
878         enum ENETUNREACH        = 101;        ///
879         enum ENETRESET          = 102;        ///
880         enum ECONNABORTED       = 103;        ///
881         enum ECONNRESET         = 104;        ///
882         enum ENOBUFS            = 105;        ///
883         enum EISCONN            = 106;        ///
884         enum ENOTCONN           = 107;        ///
885         enum ESHUTDOWN          = 108;        ///
886         enum ETOOMANYREFS       = 109;        ///
887         enum ETIMEDOUT          = 110;        ///
888         enum ECONNREFUSED       = 111;        ///
889         enum EHOSTDOWN          = 112;        ///
890         enum EHOSTUNREACH       = 113;        ///
891         enum EALREADY           = 114;        ///
892         enum EINPROGRESS        = 115;        ///
893         enum ESTALE             = 116;        ///
894         enum EUCLEAN            = 117;        ///
895         enum ENOTNAM            = 118;        ///
896         enum ENAVAIL            = 119;        ///
897         enum EISNAM             = 120;        ///
898         enum EREMOTEIO          = 121;        ///
899         enum EDQUOT             = 122;        ///
900         enum ENOMEDIUM          = 123;        ///
901         enum EMEDIUMTYPE        = 124;        ///
902         enum ECANCELED          = 125;        ///
903         enum ENOKEY             = 126;        ///
904         enum EKEYEXPIRED        = 127;        ///
905         enum EKEYREVOKED        = 128;        ///
906         enum EKEYREJECTED       = 129;        ///
907         enum EOWNERDEAD         = 130;        ///
908         enum ENOTRECOVERABLE    = 131;        ///
909         enum ERFKILL            = 132;        ///
910         enum EHWPOISON          = 133;        ///
911     }
912     else version (SPARC_Any)
913     {
914         enum EWOULDBLOCK        = EAGAIN;     ///
915         enum EINPROGRESS        = 36;         ///
916         enum EALREADY           = 37;         ///
917         enum ENOTSOCK           = 38;         ///
918         enum EDESTADDRREQ       = 39;         ///
919         enum EMSGSIZE           = 40;         ///
920         enum EPROTOTYPE         = 41;         ///
921         enum ENOPROTOOPT        = 42;         ///
922         enum EPROTONOSUPPORT    = 43;         ///
923         enum ESOCKTNOSUPPORT    = 44;         ///
924         enum EOPNOTSUPP         = 45;         ///
925         enum ENOTSUP            = EOPNOTSUPP; ///
926         enum EPFNOSUPPORT       = 46;         ///
927         enum EAFNOSUPPORT       = 47;         ///
928         enum EADDRINUSE         = 48;         ///
929         enum EADDRNOTAVAIL      = 49;         ///
930         enum ENETDOWN           = 50;         ///
931         enum ENETUNREACH        = 51;         ///
932         enum ENETRESET          = 52;         ///
933         enum ECONNABORTED       = 53;         ///
934         enum ECONNRESET         = 54;         ///
935         enum ENOBUFS            = 55;         ///
936         enum EISCONN            = 56;         ///
937         enum ENOTCONN           = 57;         ///
938         enum ESHUTDOWN          = 58;         ///
939         enum ETOOMANYREFS       = 59;         ///
940         enum ETIMEDOUT          = 60;         ///
941         enum ECONNREFUSED       = 61;         ///
942         enum ELOOP              = 62;         ///
943         enum ENAMETOOLONG       = 63;         ///
944         enum EHOSTDOWN          = 64;         ///
945         enum EHOSTUNREACH       = 65;         ///
946         enum ENOTEMPTY          = 66;         ///
947         enum EPROCLIM           = 67;         ///
948         enum EUSERS             = 68;         ///
949         enum EDQUOT             = 69;         ///
950         enum ESTALE             = 70;         ///
951         enum EREMOTE            = 71;         ///
952         enum ENOSTR             = 72;         ///
953         enum ETIME              = 73;         ///
954         enum ENOSR              = 74;         ///
955         enum ENOMSG             = 75;         ///
956         enum EBADMSG            = 76;         ///
957         enum EIDRM              = 77;         ///
958         enum EDEADLK            = 78;         ///
959         enum ENOLCK             = 79;         ///
960         enum ENONET             = 80;         ///
961         enum ERREMOTE           = 81;         ///
962         enum ENOLINK            = 82;         ///
963         enum EADV               = 83;         ///
964         enum ESRMNT             = 84;         ///
965         enum ECOMM              = 85;         ///
966         enum EPROTO             = 86;         ///
967         enum EMULTIHOP          = 87;         ///
968         enum EDOTDOT            = 88;         ///
969         enum EREMCHG            = 89;         ///
970         enum ENOSYS             = 90;         ///
971         enum ESTRPIPE           = 91;         ///
972         enum EOVERFLOW          = 92;         ///
973         enum EBADFD             = 93;         ///
974         enum ECHRNG             = 94;         ///
975         enum EL2NSYNC           = 95;         ///
976         enum EL3HLT             = 96;         ///
977         enum EL3RST             = 97;         ///
978         enum ELNRNG             = 98;         ///
979         enum EUNATCH            = 99;         ///
980         enum ENOCSI             = 100;        ///
981         enum EL2HLT             = 101;        ///
982         enum EBADE              = 102;        ///
983         enum EBADR              = 103;        ///
984         enum EXFULL             = 104;        ///
985         enum ENOANO             = 105;        ///
986         enum EBADRQC            = 106;        ///
987         enum EBADSLT            = 107;        ///
988         enum EDEADLOCK          = 108;        ///
989         enum EBFONT             = 109;        ///
990         enum ELIBEXEC           = 110;        ///
991         enum ENODATA            = 111;        ///
992         enum ELIBBAD            = 112;        ///
993         enum ENOPKG             = 113;        ///
994         enum ELIBACC            = 114;        ///
995         enum ENOTUNIQ           = 115;        ///
996         enum ERESTART           = 116;        ///
997         enum EUCLEAN            = 117;        ///
998         enum ENOTNAM            = 118;        ///
999         enum ENAVAIL            = 119;        ///
1000         enum EISNAM             = 120;        ///
1001         enum EREMOTEIO          = 121;        ///
1002         enum EILSEQ             = 122;        ///
1003         enum ELIBMAX            = 123;        ///
1004         enum ELIBSCN            = 124;        ///
1005         enum ENOMEDIUM          = 125;        ///
1006         enum EMEDIUMTYPE        = 126;        ///
1007         enum ECANCELED          = 127;        ///
1008         enum ENOKEY             = 128;        ///
1009         enum EKEYEXPIRED        = 129;        ///
1010         enum EKEYREVOKED        = 130;        ///
1011         enum EKEYREJECTED       = 131;        ///
1012         enum EOWNERDEAD         = 132;        ///
1013         enum ENOTRECOVERABLE    = 133;        ///
1014         enum ERFKILL            = 134;        ///
1015         enum EHWPOISON          = 135;        ///
1016     }
1017     else version (IBMZ_Any)
1018     {
1019         enum EDEADLK            = 35;         ///
1020         enum ENAMETOOLONG       = 36;         ///
1021         enum ENOLCK             = 37;         ///
1022         enum ENOSYS             = 38;         ///
1023         enum ENOTEMPTY          = 39;         ///
1024         enum ELOOP              = 40;         ///
1025         enum EWOULDBLOCK        = EAGAIN;     ///
1026         enum ENOMSG             = 42;         ///
1027         enum EIDRM              = 43;         ///
1028         enum ECHRNG             = 44;         ///
1029         enum EL2NSYNC           = 45;         ///
1030         enum EL3HLT             = 46;         ///
1031         enum EL3RST             = 47;         ///
1032         enum ELNRNG             = 48;         ///
1033         enum EUNATCH            = 49;         ///
1034         enum ENOCSI             = 50;         ///
1035         enum EL2HLT             = 51;         ///
1036         enum EBADE              = 52;         ///
1037         enum EBADR              = 53;         ///
1038         enum EXFULL             = 54;         ///
1039         enum ENOANO             = 55;         ///
1040         enum EBADRQC            = 56;         ///
1041         enum EBADSLT            = 57;         ///
1042         enum EDEADLOCK          = EDEADLK;    ///
1043         enum EBFONT             = 59;         ///
1044         enum ENOSTR             = 60;         ///
1045         enum ENODATA            = 61;         ///
1046         enum ETIME              = 62;         ///
1047         enum ENOSR              = 63;         ///
1048         enum ENONET             = 64;         ///
1049         enum ENOPKG             = 65;         ///
1050         enum EREMOTE            = 66;         ///
1051         enum ENOLINK            = 67;         ///
1052         enum EADV               = 68;         ///
1053         enum ESRMNT             = 69;         ///
1054         enum ECOMM              = 70;         ///
1055         enum EPROTO             = 71;         ///
1056         enum EMULTIHOP          = 72;         ///
1057         enum EDOTDOT            = 73;         ///
1058         enum EBADMSG            = 74;         ///
1059         enum EOVERFLOW          = 75;         ///
1060         enum ENOTUNIQ           = 76;         ///
1061         enum EBADFD             = 77;         ///
1062         enum EREMCHG            = 78;         ///
1063         enum ELIBACC            = 79;         ///
1064         enum ELIBBAD            = 80;         ///
1065         enum ELIBSCN            = 81;         ///
1066         enum ELIBMAX            = 82;         ///
1067         enum ELIBEXEC           = 83;         ///
1068         enum EILSEQ             = 84;         ///
1069         enum ERESTART           = 85;         ///
1070         enum ESTRPIPE           = 86;         ///
1071         enum EUSERS             = 87;         ///
1072         enum ENOTSOCK           = 88;         ///
1073         enum EDESTADDRREQ       = 89;         ///
1074         enum EMSGSIZE           = 90;         ///
1075         enum EPROTOTYPE         = 91;         ///
1076         enum ENOPROTOOPT        = 92;         ///
1077         enum EPROTONOSUPPORT    = 93;         ///
1078         enum ESOCKTNOSUPPORT    = 94;         ///
1079         enum EOPNOTSUPP         = 95;         ///
1080         enum ENOTSUP            = EOPNOTSUPP; ///
1081         enum EPFNOSUPPORT       = 96;         ///
1082         enum EAFNOSUPPORT       = 97;         ///
1083         enum EADDRINUSE         = 98;         ///
1084         enum EADDRNOTAVAIL      = 99;         ///
1085         enum ENETDOWN           = 100;        ///
1086         enum ENETUNREACH        = 101;        ///
1087         enum ENETRESET          = 102;        ///
1088         enum ECONNABORTED       = 103;        ///
1089         enum ECONNRESET         = 104;        ///
1090         enum ENOBUFS            = 105;        ///
1091         enum EISCONN            = 106;        ///
1092         enum ENOTCONN           = 107;        ///
1093         enum ESHUTDOWN          = 108;        ///
1094         enum ETOOMANYREFS       = 109;        ///
1095         enum ETIMEDOUT          = 110;        ///
1096         enum ECONNREFUSED       = 111;        ///
1097         enum EHOSTDOWN          = 112;        ///
1098         enum EHOSTUNREACH       = 113;        ///
1099         enum EALREADY           = 114;        ///
1100         enum EINPROGRESS        = 115;        ///
1101         enum ESTALE             = 116;        ///
1102         enum EUCLEAN            = 117;        ///
1103         enum ENOTNAM            = 118;        ///
1104         enum ENAVAIL            = 119;        ///
1105         enum EISNAM             = 120;        ///
1106         enum EREMOTEIO          = 121;        ///
1107         enum EDQUOT             = 122;        ///
1108         enum ENOMEDIUM          = 123;        ///
1109         enum EMEDIUMTYPE        = 124;        ///
1110         enum ECANCELED          = 125;        ///
1111         enum ENOKEY             = 126;        ///
1112         enum EKEYEXPIRED        = 127;        ///
1113         enum EKEYREVOKED        = 128;        ///
1114         enum EKEYREJECTED       = 129;        ///
1115         enum EOWNERDEAD         = 130;        ///
1116         enum ENOTRECOVERABLE    = 131;        ///
1117         enum ERFKILL            = 132;        ///
1118         enum EHWPOISON          = 133;        ///
1119     }
1120     else version (LoongArch64)
1121     {
1122         enum EDEADLK            = 35;         ///
1123         enum ENAMETOOLONG       = 36;         ///
1124         enum ENOLCK             = 37;         ///
1125         enum ENOSYS             = 38;         ///
1126         enum ENOTEMPTY          = 39;         ///
1127         enum ELOOP              = 40;         ///
1128         enum EWOULDBLOCK        = EAGAIN;     ///
1129         enum ENOMSG             = 42;         ///
1130         enum EIDRM              = 43;         ///
1131         enum ECHRNG             = 44;         ///
1132         enum EL2NSYNC           = 45;         ///
1133         enum EL3HLT             = 46;         ///
1134         enum EL3RST             = 47;         ///
1135         enum ELNRNG             = 48;         ///
1136         enum EUNATCH            = 49;         ///
1137         enum ENOCSI             = 50;         ///
1138         enum EL2HLT             = 51;         ///
1139         enum EBADE              = 52;         ///
1140         enum EBADR              = 53;         ///
1141         enum EXFULL             = 54;         ///
1142         enum ENOANO             = 55;         ///
1143         enum EBADRQC            = 56;         ///
1144         enum EBADSLT            = 57;         ///
1145         enum EDEADLOCK          = EDEADLK;    ///
1146         enum EBFONT             = 59;         ///
1147         enum ENOSTR             = 60;         ///
1148         enum ENODATA            = 61;         ///
1149         enum ETIME              = 62;         ///
1150         enum ENOSR              = 63;         ///
1151         enum ENONET             = 64;         ///
1152         enum ENOPKG             = 65;         ///
1153         enum EREMOTE            = 66;         ///
1154         enum ENOLINK            = 67;         ///
1155         enum EADV               = 68;         ///
1156         enum ESRMNT             = 69;         ///
1157         enum ECOMM              = 70;         ///
1158         enum EPROTO             = 71;         ///
1159         enum EMULTIHOP          = 72;         ///
1160         enum EDOTDOT            = 73;         ///
1161         enum EBADMSG            = 74;         ///
1162         enum EOVERFLOW          = 75;         ///
1163         enum ENOTUNIQ           = 76;         ///
1164         enum EBADFD             = 77;         ///
1165         enum EREMCHG            = 78;         ///
1166         enum ELIBACC            = 79;         ///
1167         enum ELIBBAD            = 80;         ///
1168         enum ELIBSCN            = 81;         ///
1169         enum ELIBMAX            = 82;         ///
1170         enum ELIBEXEC           = 83;         ///
1171         enum EILSEQ             = 84;         ///
1172         enum ERESTART           = 85;         ///
1173         enum ESTRPIPE           = 86;         ///
1174         enum EUSERS             = 87;         ///
1175         enum ENOTSOCK           = 88;         ///
1176         enum EDESTADDRREQ       = 89;         ///
1177         enum EMSGSIZE           = 90;         ///
1178         enum EPROTOTYPE         = 91;         ///
1179         enum ENOPROTOOPT        = 92;         ///
1180         enum EPROTONOSUPPORT    = 93;         ///
1181         enum ESOCKTNOSUPPORT    = 94;         ///
1182         enum EOPNOTSUPP         = 95;         ///
1183         enum ENOTSUP            = EOPNOTSUPP; ///
1184         enum EPFNOSUPPORT       = 96;         ///
1185         enum EAFNOSUPPORT       = 97;         ///
1186         enum EADDRINUSE         = 98;         ///
1187         enum EADDRNOTAVAIL      = 99;         ///
1188         enum ENETDOWN           = 100;        ///
1189         enum ENETUNREACH        = 101;        ///
1190         enum ENETRESET          = 102;        ///
1191         enum ECONNABORTED       = 103;        ///
1192         enum ECONNRESET         = 104;        ///
1193         enum ENOBUFS            = 105;        ///
1194         enum EISCONN            = 106;        ///
1195         enum ENOTCONN           = 107;        ///
1196         enum ESHUTDOWN          = 108;        ///
1197         enum ETOOMANYREFS       = 109;        ///
1198         enum ETIMEDOUT          = 110;        ///
1199         enum ECONNREFUSED       = 111;        ///
1200         enum EHOSTDOWN          = 112;        ///
1201         enum EHOSTUNREACH       = 113;        ///
1202         enum EALREADY           = 114;        ///
1203         enum EINPROGRESS        = 115;        ///
1204         enum ESTALE             = 116;        ///
1205         enum EUCLEAN            = 117;        ///
1206         enum ENOTNAM            = 118;        ///
1207         enum ENAVAIL            = 119;        ///
1208         enum EISNAM             = 120;        ///
1209         enum EREMOTEIO          = 121;        ///
1210         enum EDQUOT             = 122;        ///
1211         enum ENOMEDIUM          = 123;        ///
1212         enum EMEDIUMTYPE        = 124;        ///
1213         enum ECANCELED          = 125;        ///
1214         enum ENOKEY             = 126;        ///
1215         enum EKEYEXPIRED        = 127;        ///
1216         enum EKEYREVOKED        = 128;        ///
1217         enum EKEYREJECTED       = 129;        ///
1218         enum EOWNERDEAD         = 130;        ///
1219         enum ENOTRECOVERABLE    = 131;        ///
1220         enum ERFKILL            = 132;        ///
1221         enum EHWPOISON          = 133;        ///
1222     }
1223     else
1224     {
1225         static assert(false, "Architecture not supported.");
1226     }
1227 }
1228 else version (Darwin)
1229 {
1230     enum EPERM              = 1;        /// Operation not permitted
1231     enum ENOENT             = 2;        /// No such file or directory
1232     enum ESRCH              = 3;        /// No such process
1233     enum EINTR              = 4;        /// Interrupted system call
1234     enum EIO                = 5;        /// Input/output error
1235     enum ENXIO              = 6;        /// Device not configured
1236     enum E2BIG              = 7;        /// Argument list too long
1237     enum ENOEXEC            = 8;        /// Exec format error
1238     enum EBADF              = 9;        /// Bad file descriptor
1239     enum ECHILD             = 10;       /// No child processes
1240     enum EDEADLK            = 11;       /// Resource deadlock avoided
1241     enum ENOMEM             = 12;       /// Cannot allocate memory
1242     enum EACCES             = 13;       /// Permission denied
1243     enum EFAULT             = 14;       /// Bad address
1244     enum EBUSY              = 16;       /// Device busy
1245     enum EEXIST             = 17;       /// File exists
1246     enum EXDEV              = 18;       /// Cross-device link
1247     enum ENODEV             = 19;       /// Operation not supported by device
1248     enum ENOTDIR            = 20;       /// Not a directory
1249     enum EISDIR             = 21;       /// Is a directory
1250     enum EINVAL             = 22;       /// Invalid argument
1251     enum ENFILE             = 23;       /// Too many open files in system
1252     enum EMFILE             = 24;       /// Too many open files
1253     enum ENOTTY             = 25;       /// Inappropriate ioctl for device
1254     enum ETXTBSY            = 26;       /// Text file busy
1255     enum EFBIG              = 27;       /// File too large
1256     enum ENOSPC             = 28;       /// No space left on device
1257     enum ESPIPE             = 29;       /// Illegal seek
1258     enum EROFS              = 30;       /// Read-only file system
1259     enum EMLINK             = 31;       /// Too many links
1260     enum EPIPE              = 32;       /// Broken pipe
1261     enum EDOM               = 33;       /// Numerical argument out of domain
1262     enum ERANGE             = 34;       /// Result too large
1263     enum EAGAIN             = 35;       /// Resource temporarily unavailable
1264     enum EWOULDBLOCK        = EAGAIN;   /// Operation would block
1265     enum EINPROGRESS        = 36;       /// Operation now in progress
1266     enum EALREADY           = 37;       /// Operation already in progress
1267     enum ENOTSOCK           = 38;       /// Socket operation on non-socket
1268     enum EDESTADDRREQ       = 39;       /// Destination address required
1269     enum EMSGSIZE           = 40;       /// Message too long
1270     enum EPROTOTYPE         = 41;       /// Protocol wrong type for socket
1271     enum ENOPROTOOPT        = 42;       /// Protocol not available
1272     enum EPROTONOSUPPORT    = 43;       /// Protocol not supported
1273     enum ENOTSUP            = 45;       /// Operation not supported
1274     enum EOPNOTSUPP         = ENOTSUP;  /// Operation not supported on socket
1275     enum EAFNOSUPPORT       = 47;       /// Address family not supported by protocol family
1276     enum EADDRINUSE         = 48;       /// Address already in use
1277     enum EADDRNOTAVAIL      = 49;       /// Can't assign requested address
1278     enum ENETDOWN           = 50;       /// Network is down
1279     enum ENETUNREACH        = 51;       /// Network is unreachable
1280     enum ENETRESET          = 52;       /// Network dropped connection on reset
1281     enum ECONNABORTED       = 53;       /// Software caused connection abort
1282     enum ECONNRESET         = 54;       /// Connection reset by peer
1283     enum ENOBUFS            = 55;       /// No buffer space available
1284     enum EISCONN            = 56;       /// Socket is already connected
1285     enum ENOTCONN           = 57;       /// Socket is not connected
1286     enum ETIMEDOUT          = 60;       /// Operation timed out
1287     enum ECONNREFUSED       = 61;       /// Connection refused
1288     enum ELOOP              = 62;       /// Too many levels of symbolic links
1289     enum ENAMETOOLONG       = 63;       /// File name too long
1290     enum EHOSTUNREACH       = 65;       /// No route to host
1291     enum ENOTEMPTY          = 66;       /// Directory not empty
1292     enum EDQUOT             = 69;       /// Disc quota exceeded
1293     enum ESTALE             = 70;       /// Stale NFS file handle
1294     enum ENOLCK             = 77;       /// No locks available
1295     enum ENOSYS             = 78;       /// Function not implemented
1296     enum EOVERFLOW          = 84;       /// Value too large to be stored in data type
1297     enum ECANCELED          = 89;       /// Operation canceled
1298     enum EIDRM              = 90;       /// Identifier removed
1299     enum ENOMSG             = 91;       /// No message of desired type
1300     enum EILSEQ             = 92;       /// Illegal byte sequence
1301     enum EBADMSG            = 94;       /// Bad message
1302     enum EMULTIHOP          = 95;       /// Reserved
1303     enum ENODATA            = 96;       /// No message available on STREAM
1304     enum ENOLINK            = 97;       /// Reserved
1305     enum ENOSR              = 98;       /// No STREAM resources
1306     enum ENOSTR             = 99;       /// Not a STREAM
1307     enum EPROTO             = 100;      /// Protocol error
1308     enum ETIME              = 101;      /// STREAM ioctl timeout
1309     enum ELAST              = 101;      /// Must be equal largest errno
1310 }
1311 else version (FreeBSD)
1312 {
1313     enum EPERM              = 1;        /// Operation not permitted
1314     enum ENOENT             = 2;        /// No such file or directory
1315     enum ESRCH              = 3;        /// No such process
1316     enum EINTR              = 4;        /// Interrupted system call
1317     enum EIO                = 5;        /// Input/output error
1318     enum ENXIO              = 6;        /// Device not configured
1319     enum E2BIG              = 7;        /// Argument list too long
1320     enum ENOEXEC            = 8;        /// Exec format error
1321     enum EBADF              = 9;        /// Bad file descriptor
1322     enum ECHILD             = 10;       /// No child processes
1323     enum EDEADLK            = 11;       /// Resource deadlock avoided
1324     enum ENOMEM             = 12;       /// Cannot allocate memory
1325     enum EACCES             = 13;       /// Permission denied
1326     enum EFAULT             = 14;       /// Bad address
1327     enum ENOTBLK            = 15;       /// Block device required
1328     enum EBUSY              = 16;       /// Device busy
1329     enum EEXIST             = 17;       /// File exists
1330     enum EXDEV              = 18;       /// Cross-device link
1331     enum ENODEV             = 19;       /// Operation not supported by device
1332     enum ENOTDIR            = 20;       /// Not a directory
1333     enum EISDIR             = 21;       /// Is a directory
1334     enum EINVAL             = 22;       /// Invalid argument
1335     enum ENFILE             = 23;       /// Too many open files in system
1336     enum EMFILE             = 24;       /// Too many open files
1337     enum ENOTTY             = 25;       /// Inappropriate ioctl for device
1338     enum ETXTBSY            = 26;       /// Text file busy
1339     enum EFBIG              = 27;       /// File too large
1340     enum ENOSPC             = 28;       /// No space left on device
1341     enum ESPIPE             = 29;       /// Illegal seek
1342     enum EROFS              = 30;       /// Read-only file system
1343     enum EMLINK             = 31;       /// Too many links
1344     enum EPIPE              = 32;       /// Broken pipe
1345     enum EDOM               = 33;       /// Numerical argument out of domain
1346     enum ERANGE             = 34;       /// Result too large
1347     enum EAGAIN             = 35;       /// Resource temporarily unavailable
1348     enum EWOULDBLOCK        = EAGAIN;   /// Operation would block
1349     enum EINPROGRESS        = 36;       /// Operation now in progress
1350     enum EALREADY           = 37;       /// Operation already in progress
1351     enum ENOTSOCK           = 38;       /// Socket operation on non-socket
1352     enum EDESTADDRREQ       = 39;       /// Destination address required
1353     enum EMSGSIZE           = 40;       /// Message too long
1354     enum EPROTOTYPE         = 41;       /// Protocol wrong type for socket
1355     enum ENOPROTOOPT        = 42;       /// Protocol not available
1356     enum EPROTONOSUPPORT    = 43;       /// Protocol not supported
1357     enum ENOTSUP            = 45;       /// Operation not supported
1358     enum EOPNOTSUPP         = ENOTSUP;  /// Operation not supported on socket
1359     enum EAFNOSUPPORT       = 47;       /// Address family not supported by protocol family
1360     enum EADDRINUSE         = 48;       /// Address already in use
1361     enum EADDRNOTAVAIL      = 49;       /// Can't assign requested address
1362     enum ENETDOWN           = 50;       /// Network is down
1363     enum ENETUNREACH        = 51;       /// Network is unreachable
1364     enum ENETRESET          = 52;       /// Network dropped connection on reset
1365     enum ECONNABORTED       = 53;       /// Software caused connection abort
1366     enum ECONNRESET         = 54;       /// Connection reset by peer
1367     enum ENOBUFS            = 55;       /// No buffer space available
1368     enum EISCONN            = 56;       /// Socket is already connected
1369     enum ENOTCONN           = 57;       /// Socket is not connected
1370     enum ESHUTDOWN          = 58;       /// Can't send after socket shutdown
1371     enum ETOOMANYREFS       = 59;       /// Too many refrences; can't splice
1372     enum ETIMEDOUT          = 60;       /// Operation timed out
1373     enum ECONNREFUSED       = 61;       /// Connection refused
1374     enum ELOOP              = 62;       /// Too many levels of symbolic links
1375     enum ENAMETOOLONG       = 63;       /// File name too long
1376     enum EHOSTUNREACH       = 65;       /// No route to host
1377     enum ENOTEMPTY          = 66;       /// Directory not empty
1378     enum EPROCLIM           = 67;       /// Too many processes
1379     enum EUSERS             = 68;       /// Too many users
1380     enum EDQUOT             = 69;       /// Disc quota exceeded
1381     enum ESTALE             = 70;       /// Stale NFS file handle
1382     enum EREMOTE            = 71;       /// Too many levels of remote in path
1383     enum EBADRPC            = 72;       /// RPC struct is bad
1384     enum ERPCMISMATCH       = 73;       /// RPC version wrong
1385     enum EPROGUNAVAIL       = 74;       /// RPC prog. not avail
1386     enum EPROGMISMATCH      = 75;       /// Program version wrong
1387     enum EPROCUNAVAIL       = 76;       /// Bad procedure for program
1388     enum ENOLCK             = 77;       /// No locks available
1389     enum ENOSYS             = 78;       /// Function not implemented
1390     enum EFTYPE             = 79;       /// Inappropriate file type or format
1391     enum EAUTH              = 80;       /// Authentication error
1392     enum ENEEDAUTH          = 81;       /// Need authenticator
1393     enum EIDRM              = 82;       /// Itendifier removed
1394     enum ENOMSG             = 83;       /// No message of desired type
1395     enum EOVERFLOW          = 84;       /// Value too large to be stored in data type
1396     enum ECANCELED          = 85;       /// Operation canceled
1397     enum EILSEQ             = 86;       /// Illegal byte sequence
1398     enum ENOATTR            = 87;       /// Attribute not found
1399     enum EDOOFUS            = 88;       /// Programming error
1400     enum EBADMSG            = 89;       /// Bad message
1401     enum EMULTIHOP          = 90;       /// Multihop attempted
1402     enum ENOLINK            = 91;       /// Link has been severed
1403     enum EPROTO             = 92;       /// Protocol error
1404     enum ELAST              = 92;       /// Must be equal largest errno
1405 }
1406 else version (NetBSD)
1407 {
1408     // http://cvsweb.netbsd.org/bsdweb.cgi/~checkout~/src/sys/sys/errno.h
1409     enum EPERM           = 1;
1410     enum ENOENT          = 2;
1411     enum ESRCH           = 3;
1412     enum EINTR           = 4;
1413     enum EIO             = 5;
1414     enum ENXIO           = 6;
1415     enum E2BIG           = 7;
1416     enum ENOEXEC         = 8;
1417     enum EBADF           = 9;
1418     enum ECHILD          = 10;
1419     enum EDEADLK         = 11;
1420     ///
1421     enum ENOMEM          = 12;
1422     enum EACCES          = 13;
1423     enum EFAULT          = 14;
1424     enum ENOTBLK         = 15;
1425     enum EBUSY           = 16;
1426     enum EEXIST          = 17;
1427     enum EXDEV           = 18;
1428     enum ENODEV          = 19;
1429     enum ENOTDIR         = 20;
1430     enum EISDIR          = 21;
1431     enum EINVAL          = 22;
1432     enum ENFILE          = 23;
1433     enum EMFILE          = 24;
1434     enum ENOTTY          = 25;
1435     enum ETXTBSY         = 26;
1436     enum EFBIG           = 27;
1437     enum ENOSPC          = 28;
1438     enum ESPIPE          = 29;
1439     enum EROFS           = 30;
1440     enum EMLINK          = 31;
1441     enum EPIPE           = 32;
1442     ///
1443     enum EDOM            = 33;
1444     enum ERANGE          = 34;
1445 
1446     ///
1447     enum EAGAIN          = 35;
1448     enum EWOULDBLOCK     = EAGAIN;
1449     enum EINPROGRESS     = 36;
1450     enum EALREADY        = 37;
1451 
1452     ///
1453     enum ENOTSOCK        = 38;
1454     enum EDESTADDRREQ    = 39;
1455     enum EMSGSIZE        = 40;
1456     enum EPROTOTYPE      = 41;
1457     enum ENOPROTOOPT     = 42;
1458     enum EPROTONOSUPPORT = 43;
1459     enum ESOCKTNOSUPPORT = 44;
1460     enum EOPNOTSUPP      = 45;
1461     enum EPFNOSUPPORT    = 46;
1462     enum EAFNOSUPPORT    = 47;
1463     enum EADDRINUSE      = 48;
1464     enum EADDRNOTAVAIL   = 49;
1465 
1466     ///
1467     enum ENETDOWN        = 50;
1468     enum ENETUNREACH     = 51;
1469     enum ENETRESET       = 52;
1470     enum ECONNABORTED    = 53;
1471     enum ECONNRESET      = 54;
1472     enum ENOBUFS         = 55;
1473     enum EISCONN         = 56;
1474     enum ENOTCONN        = 57;
1475     enum ESHUTDOWN       = 58;
1476     enum ETOOMANYREFS    = 59;
1477     enum ETIMEDOUT       = 60;
1478     enum ECONNREFUSED    = 61;
1479     enum ELOOP           = 62;
1480     enum ENAMETOOLONG    = 63;
1481 
1482     ///
1483     enum EHOSTDOWN       = 64;
1484     enum EHOSTUNREACH    = 65;
1485     enum ENOTEMPTY       = 66;
1486 
1487     ///
1488     enum EPROCLIM        = 67;
1489     enum EUSERS          = 68;
1490     enum EDQUOT          = 69;
1491 
1492     ///
1493     enum ESTALE          = 70;
1494     enum EREMOTE         = 71;
1495     enum EBADRPC         = 72;
1496     enum ERPCMISMATCH    = 73;
1497     enum EPROGUNAVAIL    = 74;
1498     enum EPROGMISMATCH   = 75;
1499     enum EPROCUNAVAIL    = 76;
1500 
1501     enum ENOLCK          = 77;
1502     enum ENOSYS          = 78;
1503 
1504     enum EFTYPE          = 79;
1505     enum EAUTH           = 80;
1506     enum ENEEDAUTH       = 81;
1507 
1508     ///
1509     enum EIDRM           = 82;
1510     enum ENOMSG          = 83;
1511     enum EOVERFLOW       = 84;
1512     ///
1513     enum EILSEQ          = 85;
1514 
1515     ///
1516     enum ENOTSUP         = 86;
1517 
1518     ///
1519     enum ECANCELED       = 87;
1520 
1521     ///
1522     enum EBADMSG         = 88;
1523 
1524     ///
1525     enum ENODATA         = 89;
1526     enum ENOSR           = 90;
1527     enum ENOSTR          = 91;
1528     enum ETIME           = 92;
1529 
1530     ///
1531     enum ENOATTR         = 93;
1532 
1533     ///
1534     enum EMULTIHOP       = 94;
1535     enum ENOLINK         = 95;
1536     enum EPROTO          = 96;
1537 }
1538 else version (OpenBSD)
1539 {
1540     enum EPERM              = 1;        /// Operation not permitted
1541     enum ENOENT             = 2;        /// No such file or directory
1542     enum ESRCH              = 3;        /// No such process
1543     enum EINTR              = 4;        /// Interrupted system call
1544     enum EIO                = 5;        /// Input/output error
1545     enum ENXIO              = 6;        /// Device not configured
1546     enum E2BIG              = 7;        /// Argument list too long
1547     enum ENOEXEC            = 8;        /// Exec format error
1548     enum EBADF              = 9;        /// Bad file descriptor
1549     enum ECHILD             = 10;       /// No child processes
1550     enum EDEADLK            = 11;       /// Resource deadlock avoided
1551     enum ENOMEM             = 12;       /// Cannot allocate memory
1552     enum EACCES             = 13;       /// Permission denied
1553     enum EFAULT             = 14;       /// Bad address
1554     enum ENOTBLK            = 15;       /// Block device required
1555     enum EBUSY              = 16;       /// Device busy
1556     enum EEXIST             = 17;       /// File exists
1557     enum EXDEV              = 18;       /// Cross-device link
1558     enum ENODEV             = 19;       /// Operation not supported by device
1559     enum ENOTDIR            = 20;       /// Not a directory
1560     enum EISDIR             = 21;       /// Is a directory
1561     enum EINVAL             = 22;       /// Invalid argument
1562     enum ENFILE             = 23;       /// Too many open files in system
1563     enum EMFILE             = 24;       /// Too many open files
1564     enum ENOTTY             = 25;       /// Inappropriate ioctl for device
1565     enum ETXTBSY            = 26;       /// Text file busy
1566     enum EFBIG              = 27;       /// File too large
1567     enum ENOSPC             = 28;       /// No space left on device
1568     enum ESPIPE             = 29;       /// Illegal seek
1569     enum EROFS              = 30;       /// Read-only file system
1570     enum EMLINK             = 31;       /// Too many links
1571     enum EPIPE              = 32;       /// Broken pipe
1572     enum EDOM               = 33;       /// Numerical argument out of domain
1573     enum ERANGE             = 34;       /// Result too large
1574     enum EAGAIN             = 35;       /// Resource temporarily unavailable
1575     enum EWOULDBLOCK        = EAGAIN;   /// Operation would block
1576     enum EINPROGRESS        = 36;       /// Operation now in progress
1577     enum EALREADY           = 37;       /// Operation already in progress
1578     enum ENOTSOCK           = 38;       /// Socket operation on non-socket
1579     enum EDESTADDRREQ       = 39;       /// Destination address required
1580     enum EMSGSIZE           = 40;       /// Message too long
1581     enum EPROTOTYPE         = 41;       /// Protocol wrong type for socket
1582     enum ENOPROTOOPT        = 42;       /// Protocol not available
1583     enum EPROTONOSUPPORT    = 43;       /// Protocol not supported
1584     enum ESOCKTNOSUPPORT    = 44;       /// Socket type not supported
1585     enum EOPNOTSUPP         = 45;       /// Operation not supported
1586     enum EPFNOSUPPORT       = 46;       /// Protocol family not supported
1587     enum EAFNOSUPPORT       = 47;       /// Address family not supported by protocol family
1588     enum EADDRINUSE         = 48;       /// Address already in use
1589     enum EADDRNOTAVAIL      = 49;       /// Can't assign requested address
1590     enum ENETDOWN           = 50;       /// Network is down
1591     enum ENETUNREACH        = 51;       /// Network is unreachable
1592     enum ENETRESET          = 52;       /// Network dropped connection on reset
1593     enum ECONNABORTED       = 53;       /// Software caused connection abort
1594     enum ECONNRESET         = 54;       /// Connection reset by peer
1595     enum ENOBUFS            = 55;       /// No buffer space available
1596     enum EISCONN            = 56;       /// Socket is already connected
1597     enum ENOTCONN           = 57;       /// Socket is not connected
1598     enum ESHUTDOWN          = 58;       /// Can't send after socket shutdown
1599     enum ETOOMANYREFS       = 59;       /// Too many references: can't splice
1600     enum ETIMEDOUT          = 60;       /// Operation timed out
1601     enum ECONNREFUSED       = 61;       /// Connection refused
1602     enum ELOOP              = 62;       /// Too many levels of symbolic links
1603     enum ENAMETOOLONG       = 63;       /// File name too long
1604     enum EHOSTDOWN          = 64;       /// Host is down
1605     enum EHOSTUNREACH       = 65;       /// No route to host
1606     enum ENOTEMPTY          = 66;       /// Directory not empty
1607     enum EPROCLIM           = 67;       /// Too many processes
1608     enum EUSERS             = 68;       /// Too many users
1609     enum EDQUOT             = 69;       /// Disk quota exceeded
1610     enum ESTALE             = 70;       /// Stale NFS file handle
1611     enum EREMOTE            = 71;       /// Too many levels of remote in path
1612     enum EBADRPC            = 72;       /// RPC struct is bad
1613     enum ERPCMISMATCH       = 73;       /// RPC version wrong
1614     enum EPROGUNAVAIL       = 74;       /// RPC program not available
1615     enum EPROGMISMATCH      = 75;       /// Program version wrong
1616     enum EPROCUNAVAIL       = 76;       /// Bad procedure for program
1617     enum ENOLCK             = 77;       /// No locks available
1618     enum ENOSYS             = 78;       /// Function not implemented
1619     enum EFTYPE             = 79;       /// Inappropriate file type or format
1620     enum EAUTH              = 80;       /// Authentication error
1621     enum ENEEDAUTH          = 81;       /// Need authenticator
1622     enum EIPSEC             = 82;       /// IPsec processing failure
1623     enum ENOATTR            = 83;       /// Attribute not found
1624     enum EILSEQ             = 84;       /// Illegal byte sequence
1625     enum ENOMEDIUM          = 85;       /// No medium found
1626     enum EMEDIUMTYPE        = 86;       /// Wrong medium type
1627     enum EOVERFLOW          = 87;       /// Value too large to be stored in data type
1628     enum ECANCELED          = 88;       /// Operation canceled
1629     enum EIDRM              = 89;       /// Identifier removed
1630     enum ENOMSG             = 90;       /// No message of desired type
1631     enum ENOTSUP            = 91;       /// Not supported
1632     enum EBADMSG            = 92;       /// Bad message
1633     enum ENOTRECOVERABLE    = 93;       /// State not recoverable
1634     enum EOWNERDEAD         = 94;       /// Previous owner died
1635     enum EPROTO             = 95;       /// Protocol error
1636     enum ELAST              = 95;       /// Must be equal largest errno
1637 }
1638 else version (DragonFlyBSD)
1639 {
1640     enum EPERM              = 1;
1641     enum ENOENT             = 2;
1642     enum ESRCH              = 3;
1643     enum EINTR              = 4;
1644     enum EIO                = 5;
1645     enum ENXIO              = 6;
1646     enum E2BIG              = 7;
1647     enum ENOEXEC            = 8;
1648     enum EBADF              = 9;
1649     enum ECHILD             = 10;
1650     enum EDEADLK            = 11;
1651     enum ENOMEM             = 12;
1652     enum EACCES             = 13;
1653     enum EFAULT             = 14;
1654     enum ENOTBLK            = 15;
1655     enum EBUSY              = 16;
1656     enum EEXIST             = 17;
1657     enum EXDEV              = 18;
1658     enum ENODEV             = 19;
1659     enum ENOTDIR            = 20;
1660     enum EISDIR             = 21;
1661     enum EINVAL             = 22;
1662     enum ENFILE             = 23;
1663     enum EMFILE             = 24;
1664     enum ENOTTY             = 25;
1665     enum ETXTBSY            = 26;
1666     enum EFBIG              = 27;
1667     enum ENOSPC             = 28;
1668     enum ESPIPE             = 29;
1669     enum EROFS              = 30;
1670     enum EMLINK             = 31;
1671     enum EPIPE              = 32;
1672     enum EDOM               = 33;
1673     enum ERANGE             = 34;
1674     enum EAGAIN             = 35;
1675     enum EWOULDBLOCK        = EAGAIN;
1676     enum EINPROGRESS        = 36;
1677     enum EALREADY           = 37;
1678     enum ENOTSOCK           = 38;
1679     enum EDESTADDRREQ       = 39;
1680     enum EMSGSIZE           = 40;
1681     enum EPROTOTYPE         = 41;
1682     enum ENOPROTOOPT        = 42;
1683     enum EPROTONOSUPPORT    = 43;
1684     enum ENOTSUP            = 45;
1685     enum EOPNOTSUPP         = ENOTSUP;
1686     enum EPFNOSUPPORT       = 46;
1687     enum EAFNOSUPPORT       = 47;
1688     enum EADDRINUSE         = 48;
1689     enum EADDRNOTAVAIL      = 49;
1690     enum ENETDOWN           = 50;
1691     enum ENETUNREACH        = 51;
1692     enum ENETRESET          = 52;
1693     enum ECONNABORTED       = 53;
1694     enum ECONNRESET         = 54;
1695     enum ENOBUFS            = 55;
1696     enum EISCONN            = 56;
1697     enum ENOTCONN           = 57;
1698     enum ESHUTDOWN          = 58;
1699     enum ETOOMANYREFS       = 59;
1700     enum ETIMEDOUT          = 60;
1701     enum ECONNREFUSED       = 61;
1702     enum ELOOP              = 62;
1703     enum ENAMETOOLONG       = 63;
1704     enum EHOSTUNREACH       = 65;
1705     enum ENOTEMPTY          = 66;
1706     enum EPROCLIM           = 67;
1707     enum EUSERS             = 68;
1708     enum EDQUOT             = 69;
1709     enum ESTALE             = 70;
1710     enum EREMOTE            = 71;
1711     enum EBADRPC            = 72;
1712     enum ERPCMISMATCH       = 73;
1713     enum EPROGUNAVAIL       = 74;
1714     enum EPROGMISMATCH      = 75;
1715     enum EPROCUNAVAIL       = 76;
1716     enum ENOLCK             = 77;
1717     enum ENOSYS             = 78;
1718     enum EFTYPE             = 79;
1719     enum EAUTH              = 80;
1720     enum ENEEDAUTH          = 81;
1721     enum EIDRM              = 82;
1722     enum ENOMSG             = 83;
1723     enum EOVERFLOW          = 84;
1724     enum ECANCELED          = 85;
1725     enum EILSEQ             = 86;
1726     enum ENOATTR            = 87;
1727     enum EDOOFUS            = 88;
1728     enum EBADMSG            = 89;
1729     enum EMULTIHOP          = 90;
1730     enum ENOLINK            = 91;
1731     enum EPROTO             = 92;
1732     enum ENOMEDIUM          = 93;
1733     enum EUNUSED94          = 94;
1734     enum EUNUSED95          = 95;
1735     enum EUNUSED96          = 96;
1736     enum EUNUSED97          = 97;
1737     enum EUNUSED98          = 98;
1738     enum EASYNC             = 99;
1739     enum ELAST              = 99;
1740 }
1741 else version (Solaris)
1742 {
1743     enum EPERM =  1;              ///  Not super-user
1744     enum ENOENT = 2;              ///  No such file or directory
1745     enum ESRCH =  3;              ///  No such process
1746     enum EINTR =  4;              ///  interrupted system call
1747     enum EIO =    5;              ///  I/O error
1748     enum ENXIO =  6;              ///  No such device or address
1749     enum E2BIG =  7;              ///  Arg list too long
1750     enum ENOEXEC = 8;             ///  Exec format error
1751     enum EBADF =  9;              ///  Bad file number
1752     enum ECHILD = 10;             ///  No children
1753     enum EAGAIN = 11;             ///  Resource temporarily unavailable
1754     enum ENOMEM = 12;             ///  Not enough core
1755     enum EACCES = 13;             ///  Permission denied
1756     enum EFAULT = 14;             ///  Bad address
1757     enum ENOTBLK = 15;            ///  Block device required
1758     enum EBUSY =  16;             ///  Mount device busy
1759     enum EEXIST = 17;             ///  File exists
1760     enum EXDEV =  18;             ///  Cross-device link
1761     enum ENODEV = 19;             ///  No such device
1762     enum ENOTDIR = 20;            ///  Not a directory
1763     enum EISDIR = 21;             ///  Is a directory
1764     enum EINVAL = 22;             ///  Invalid argument
1765     enum ENFILE = 23;             ///  File table overflow
1766     enum EMFILE = 24;             ///  Too many open files
1767     enum ENOTTY = 25;             ///  Inappropriate ioctl for device
1768     enum ETXTBSY = 26;            ///  Text file busy
1769     enum EFBIG =  27;             ///  File too large
1770     enum ENOSPC = 28;             ///  No space left on device
1771     enum ESPIPE = 29;             ///  Illegal seek
1772     enum EROFS =  30;             ///  Read only file system
1773     enum EMLINK = 31;             ///  Too many links
1774     enum EPIPE =  32;             ///  Broken pipe
1775     enum EDOM =   33;             ///  Math arg out of domain of func
1776     enum ERANGE = 34;             ///  Math result not representable
1777     enum ENOMSG = 35;             ///  No message of desired type
1778     enum EIDRM =  36;             ///  Identifier removed
1779     enum ECHRNG = 37;             ///  Channel number out of range
1780     enum EL2NSYNC = 38;           ///  Level 2 not synchronized
1781     enum EL3HLT = 39;             ///  Level 3 halted
1782     enum EL3RST = 40;             ///  Level 3 reset
1783     enum ELNRNG = 41;             ///  Link number out of range
1784     enum EUNATCH = 42;            ///  Protocol driver not attached
1785     enum ENOCSI = 43;             ///  No CSI structure available
1786     enum EL2HLT = 44;             ///  Level 2 halted
1787     enum EDEADLK = 45;            ///  Deadlock condition.
1788     enum ENOLCK = 46;             ///  No record locks available.
1789     enum ECANCELED = 47;          ///  Operation canceled
1790     enum ENOTSUP = 48;            ///  Operation not supported
1791     enum EDQUOT = 49;             ///  Disc quota exceeded
1792     enum EBADE =  50;             ///  invalid exchange
1793     enum EBADR =  51;             ///  invalid request descriptor
1794     enum EXFULL = 52;             ///  exchange full
1795     enum ENOANO = 53;             ///  no anode
1796     enum EBADRQC = 54;            ///  invalid request code
1797     enum EBADSLT = 55;            ///  invalid slot
1798     enum EDEADLOCK = 56;          ///  file locking deadlock error
1799     enum EBFONT = 57;             ///  bad font file fmt
1800     enum EOWNERDEAD =     58;     ///  process died with the lock
1801     enum ENOTRECOVERABLE = 59;    ///  lock is not recoverable
1802     enum ENOSTR = 60;             ///  Device not a stream
1803     enum ENODATA = 61;            ///  no data (for no delay io)
1804     enum ETIME =  62;             ///  timer expired
1805     enum ENOSR =  63;             ///  out of streams resources
1806     enum ENONET = 64;             ///  Machine is not on the network
1807     enum ENOPKG = 65;             ///  Package not installed
1808     enum EREMOTE = 66;            ///  The object is remote
1809     enum ENOLINK = 67;            ///  the link has been severed
1810     enum EADV =   68;             ///  advertise error
1811     enum ESRMNT = 69;             ///  srmount error
1812     enum ECOMM =  70;             ///  Communication error on send
1813     enum EPROTO = 71;             ///  Protocol error
1814     enum ELOCKUNMAPPED =  72;     ///  locked lock was unmapped
1815     enum ENOTACTIVE = 73;         ///  Facility is not active
1816     enum EMULTIHOP = 74;          ///  multihop attempted
1817     enum EBADMSG = 77;            ///  trying to read unreadable message
1818     enum ENAMETOOLONG = 78;       ///  path name is too long
1819     enum EOVERFLOW = 79;          ///  value too large to be stored in data type
1820     enum ENOTUNIQ = 80;           ///  given log. name not unique
1821     enum EBADFD =  81;            ///  f.d. invalid for this operation
1822     enum EREMCHG = 82;            ///  Remote address changed
1823     enum ELIBACC = 83;            ///  Can't access a needed shared lib.
1824     enum ELIBBAD = 84;            ///  Accessing a corrupted shared lib.
1825     enum ELIBSCN = 85;            ///  .lib section in a.out corrupted.
1826     enum ELIBMAX = 86;            ///  Attempting to link in too many libs.
1827     enum ELIBEXEC = 87;           ///  Attempting to exec a shared library.
1828     enum EILSEQ = 88;             ///  Illegal byte sequence.
1829     enum ENOSYS = 89;             ///  Unsupported file system operation
1830     enum ELOOP =  90;             ///  Symbolic link loop
1831     enum ERESTART = 91;           ///  Restartable system call
1832     enum ESTRPIPE = 92;           ///  if pipe/FIFO, don't sleep in stream head
1833     enum ENOTEMPTY = 93;          ///  directory not empty
1834     enum EUSERS = 94;             ///  Too many users (for UFS)
1835     enum ENOTSOCK =       95;     ///  Socket operation on non-socket
1836     enum EDESTADDRREQ =   96;     ///  Destination address required
1837     enum EMSGSIZE =       97;     ///  Message too long
1838     enum EPROTOTYPE =     98;     ///  Protocol wrong type for socket
1839     enum ENOPROTOOPT =    99;     ///  Protocol not available
1840     enum EPROTONOSUPPORT = 120;   ///  Protocol not supported
1841     enum ESOCKTNOSUPPORT = 121;   ///  Socket type not supported
1842     enum EOPNOTSUPP =     122;    ///  Operation not supported on socket
1843     enum EPFNOSUPPORT =   123;    ///  Protocol family not supported
1844     enum EAFNOSUPPORT =   124;    ///  Address family not supported by the protocol family
1845     enum EADDRINUSE =     125;    ///  Address already in use
1846     enum EADDRNOTAVAIL =   126;   ///  Can't assign requested address
1847     enum ENETDOWN =       127;    ///  Network is down
1848     enum ENETUNREACH =    128;    ///  Network is unreachable
1849     enum ENETRESET =      129;    ///  Network dropped connection because of reset
1850     enum ECONNABORTED =   130;    ///  Software caused connection abort
1851     enum ECONNRESET =     131;    ///  Connection reset by peer
1852     enum ENOBUFS =        132;    ///  No buffer space available
1853     enum EISCONN =        133;    ///  Socket is already connected
1854     enum ENOTCONN =       134;    ///  Socket is not connected
1855     enum ESHUTDOWN =      143;    ///  Can't send after socket shutdown
1856     enum ETOOMANYREFS =   144;    ///  Too many references: can't splice
1857     enum ETIMEDOUT =      145;    ///  Connection timed out
1858     enum ECONNREFUSED =   146;    ///  Connection refused
1859     enum EHOSTDOWN =      147;    ///  Host is down
1860     enum EHOSTUNREACH =   148;    ///  No route to host
1861     enum EWOULDBLOCK =    EAGAIN; ///  Resource temporarily unavailable
1862     enum EALREADY =       149;    ///  operation already in progress
1863     enum EINPROGRESS =    150;    ///  operation now in progress
1864     enum ESTALE =         151;    ///  Stale NFS file handle
1865 }
1866 else version (Haiku)
1867 {
1868     // https://github.com/haiku/haiku/blob/master/headers/os/support/Errors.h
1869     // https://github.com/haiku/haiku/blob/master/headers/build/os/support/Errors.h
1870     import core.stdc.limits : INT_MIN;
1871     enum B_GENERAL_ERROR_BASE        = INT_MIN;
1872     enum B_OS_ERROR_BASE             = (B_GENERAL_ERROR_BASE + 0x1000);
1873     enum B_APP_ERROR_BASE            = (B_GENERAL_ERROR_BASE + 0x2000);
1874     enum B_INTERFACE_ERROR_BASE      = (B_GENERAL_ERROR_BASE + 0x3000);
1875     enum B_MEDIA_ERROR_BASE          = (B_GENERAL_ERROR_BASE + 0x4000);
1876                                             /* - 0x41ff */
1877     enum B_TRANSLATION_ERROR_BASE    = (B_GENERAL_ERROR_BASE + 0x4800);
1878                                             /* - 0x48ff */
1879     enum B_MIDI_ERROR_BASE           = (B_GENERAL_ERROR_BASE + 0x5000);
1880     enum B_STORAGE_ERROR_BASE        = (B_GENERAL_ERROR_BASE + 0x6000);
1881     enum B_POSIX_ERROR_BASE          = (B_GENERAL_ERROR_BASE + 0x7000);
1882     enum B_MAIL_ERROR_BASE           = (B_GENERAL_ERROR_BASE + 0x8000);
1883     enum B_PRINT_ERROR_BASE          = (B_GENERAL_ERROR_BASE + 0x9000);
1884     enum B_DEVICE_ERROR_BASE         = (B_GENERAL_ERROR_BASE + 0xa000);
1885 
1886     /* General Errors */
1887     enum B_NO_MEMORY                 = (B_GENERAL_ERROR_BASE + 0);
1888     enum B_IO_ERROR                  = (B_GENERAL_ERROR_BASE + 1);
1889     enum B_PERMISSION_DENIED         = (B_GENERAL_ERROR_BASE + 2);
1890     enum B_BAD_INDEX                 = (B_GENERAL_ERROR_BASE + 3);
1891     enum B_BAD_TYPE                  = (B_GENERAL_ERROR_BASE + 4);
1892     enum B_BAD_VALUE                 = (B_GENERAL_ERROR_BASE + 5);
1893     enum B_MISMATCHED_VALUES         = (B_GENERAL_ERROR_BASE + 6);
1894     enum B_NAME_NOT_FOUND            = (B_GENERAL_ERROR_BASE + 7);
1895     enum B_NAME_IN_USE               = (B_GENERAL_ERROR_BASE + 8);
1896     enum B_TIMED_OUT                 = (B_GENERAL_ERROR_BASE + 9);
1897     enum B_INTERRUPTED               = (B_GENERAL_ERROR_BASE + 10);
1898     enum B_WOULD_BLOCK               = (B_GENERAL_ERROR_BASE + 11);
1899     enum B_CANCELED                  = (B_GENERAL_ERROR_BASE + 12);
1900     enum B_NO_INIT                   = (B_GENERAL_ERROR_BASE + 13);
1901     enum B_NOT_INITIALIZED           = (B_GENERAL_ERROR_BASE + 13);
1902     enum B_BUSY                      = (B_GENERAL_ERROR_BASE + 14);
1903     enum B_NOT_ALLOWED               = (B_GENERAL_ERROR_BASE + 15);
1904     enum B_BAD_DATA                  = (B_GENERAL_ERROR_BASE + 16);
1905     enum B_DONT_DO_THAT              = (B_GENERAL_ERROR_BASE + 17);
1906 
1907     enum B_ERROR                     = (-1);
1908     enum B_OK                        = (int(0));
1909     enum B_NO_ERROR                  = (int(0));
1910 
1911     /* Kernel Kit Errors */
1912     enum B_BAD_SEM_ID                = (B_OS_ERROR_BASE + 0);
1913     enum B_NO_MORE_SEMS              = (B_OS_ERROR_BASE + 1);
1914 
1915     enum B_BAD_THREAD_ID             = (B_OS_ERROR_BASE + 0x100);
1916     enum B_NO_MORE_THREADS           = (B_OS_ERROR_BASE + 0x101);
1917     enum B_BAD_THREAD_STATE          = (B_OS_ERROR_BASE + 0x102);
1918     enum B_BAD_TEAM_ID               = (B_OS_ERROR_BASE + 0x103);
1919     enum B_NO_MORE_TEAMS             = (B_OS_ERROR_BASE + 0x104);
1920 
1921     enum B_BAD_PORT_ID               = (B_OS_ERROR_BASE + 0x200);
1922     enum B_NO_MORE_PORTS             = (B_OS_ERROR_BASE + 0x201);
1923 
1924     enum B_BAD_IMAGE_ID              = (B_OS_ERROR_BASE + 0x300);
1925     enum B_BAD_ADDRESS               = (B_OS_ERROR_BASE + 0x301);
1926     enum B_NOT_AN_EXECUTABLE         = (B_OS_ERROR_BASE + 0x302);
1927     enum B_MISSING_LIBRARY           = (B_OS_ERROR_BASE + 0x303);
1928     enum B_MISSING_SYMBOL            = (B_OS_ERROR_BASE + 0x304);
1929     enum B_UNKNOWN_EXECUTABLE        = (B_OS_ERROR_BASE + 0x305);
1930     enum B_LEGACY_EXECUTABLE         = (B_OS_ERROR_BASE + 0x306);
1931 
1932     enum B_DEBUGGER_ALREADY_INSTALLED    = (B_OS_ERROR_BASE + 0x400);
1933 
1934     /* Application Kit Errors */
1935     enum B_BAD_REPLY                         = (B_APP_ERROR_BASE + 0);
1936     enum B_DUPLICATE_REPLY                   = (B_APP_ERROR_BASE + 1);
1937     enum B_MESSAGE_TO_SELF                   = (B_APP_ERROR_BASE + 2);
1938     enum B_BAD_HANDLER                       = (B_APP_ERROR_BASE + 3);
1939     enum B_ALREADY_RUNNING                   = (B_APP_ERROR_BASE + 4);
1940     enum B_LAUNCH_FAILED                     = (B_APP_ERROR_BASE + 5);
1941     enum B_AMBIGUOUS_APP_LAUNCH              = (B_APP_ERROR_BASE + 6);
1942     enum B_UNKNOWN_MIME_TYPE                 = (B_APP_ERROR_BASE + 7);
1943     enum B_BAD_SCRIPT_SYNTAX                 = (B_APP_ERROR_BASE + 8);
1944     enum B_LAUNCH_FAILED_NO_RESOLVE_LINK     = (B_APP_ERROR_BASE + 9);
1945     enum B_LAUNCH_FAILED_EXECUTABLE          = (B_APP_ERROR_BASE + 10);
1946     enum B_LAUNCH_FAILED_APP_NOT_FOUND       = (B_APP_ERROR_BASE + 11);
1947     enum B_LAUNCH_FAILED_APP_IN_TRASH        = (B_APP_ERROR_BASE + 12);
1948     enum B_LAUNCH_FAILED_NO_PREFERRED_APP    = (B_APP_ERROR_BASE + 13);
1949     enum B_LAUNCH_FAILED_FILES_APP_NOT_FOUND = (B_APP_ERROR_BASE + 14);
1950     enum B_BAD_MIME_SNIFFER_RULE             = (B_APP_ERROR_BASE + 15);
1951     enum B_NOT_A_MESSAGE                     = (B_APP_ERROR_BASE + 16);
1952     enum B_SHUTDOWN_CANCELLED                = (B_APP_ERROR_BASE + 17);
1953     enum B_SHUTTING_DOWN                     = (B_APP_ERROR_BASE + 18);
1954 
1955     /* Storage Kit/File System Errors */
1956     enum B_FILE_ERROR                        = (B_STORAGE_ERROR_BASE + 0);
1957     enum B_FILE_NOT_FOUND                    = (B_STORAGE_ERROR_BASE + 1);
1958                 /* deprecated: use B_ENTRY_NOT_FOUND instead */
1959     enum B_FILE_EXISTS                       = (B_STORAGE_ERROR_BASE + 2);
1960     enum B_ENTRY_NOT_FOUND                   = (B_STORAGE_ERROR_BASE + 3);
1961     enum B_NAME_TOO_LONG                     = (B_STORAGE_ERROR_BASE + 4);
1962     enum B_NOT_A_DIRECTORY                   = (B_STORAGE_ERROR_BASE + 5);
1963     enum B_DIRECTORY_NOT_EMPTY               = (B_STORAGE_ERROR_BASE + 6);
1964     enum B_DEVICE_FULL                       = (B_STORAGE_ERROR_BASE + 7);
1965     enum B_READ_ONLY_DEVICE                  = (B_STORAGE_ERROR_BASE + 8);
1966     enum B_IS_A_DIRECTORY                    = (B_STORAGE_ERROR_BASE + 9);
1967     enum B_NO_MORE_FDS                       = (B_STORAGE_ERROR_BASE + 10);
1968     enum B_CROSS_DEVICE_LINK                 = (B_STORAGE_ERROR_BASE + 11);
1969     enum B_LINK_LIMIT                        = (B_STORAGE_ERROR_BASE + 12);
1970     enum B_BUSTED_PIPE                       = (B_STORAGE_ERROR_BASE + 13);
1971     enum B_UNSUPPORTED                       = (B_STORAGE_ERROR_BASE + 14);
1972     enum B_PARTITION_TOO_SMALL               = (B_STORAGE_ERROR_BASE + 15);
1973     enum B_PARTIAL_READ                      = (B_STORAGE_ERROR_BASE + 16);
1974     enum B_PARTIAL_WRITE                     = (B_STORAGE_ERROR_BASE + 17);
1975 
1976     /* POSIX Errors */
1977     enum B_USE_POSITIVE_POSIX_ERRORS = false;
1978 
1979     static if (B_USE_POSITIVE_POSIX_ERRORS)
1980     {
1981         enum B_TO_POSIX_ERROR(int code) = -code;
1982     }
1983     else
1984     {
1985         enum B_TO_POSIX_ERROR(int code) = code;
1986     }
1987     alias B_FROM_POSIX_ERROR = B_TO_POSIX_ERROR;
1988 
1989     enum B_POSIX_ENOMEM  = B_TO_POSIX_ERROR!(B_POSIX_ERROR_BASE + 0);
1990     enum E2BIG           = B_TO_POSIX_ERROR!(B_POSIX_ERROR_BASE + 1);
1991     enum ECHILD          = B_TO_POSIX_ERROR!(B_POSIX_ERROR_BASE + 2);
1992     enum EDEADLK         = B_TO_POSIX_ERROR!(B_POSIX_ERROR_BASE + 3);
1993     enum EFBIG           = B_TO_POSIX_ERROR!(B_POSIX_ERROR_BASE + 4);
1994     enum EMLINK          = B_TO_POSIX_ERROR!(B_POSIX_ERROR_BASE + 5);
1995     enum ENFILE          = B_TO_POSIX_ERROR!(B_POSIX_ERROR_BASE + 6);
1996     enum ENODEV          = B_TO_POSIX_ERROR!(B_POSIX_ERROR_BASE + 7);
1997     enum ENOLCK          = B_TO_POSIX_ERROR!(B_POSIX_ERROR_BASE + 8);
1998     enum ENOSYS          = B_TO_POSIX_ERROR!(B_POSIX_ERROR_BASE + 9);
1999     enum ENOTTY          = B_TO_POSIX_ERROR!(B_POSIX_ERROR_BASE + 10);
2000     enum ENXIO           = B_TO_POSIX_ERROR!(B_POSIX_ERROR_BASE + 11);
2001     enum ESPIPE          = B_TO_POSIX_ERROR!(B_POSIX_ERROR_BASE + 12);
2002     enum ESRCH           = B_TO_POSIX_ERROR!(B_POSIX_ERROR_BASE + 13);
2003     enum EFPOS           = B_TO_POSIX_ERROR!(B_POSIX_ERROR_BASE + 14);
2004     enum ESIGPARM        = B_TO_POSIX_ERROR!(B_POSIX_ERROR_BASE + 15);
2005     enum EDOM            = B_TO_POSIX_ERROR!(B_POSIX_ERROR_BASE + 16);
2006     enum ERANGE          = B_TO_POSIX_ERROR!(B_POSIX_ERROR_BASE + 17);
2007     enum EPROTOTYPE      = B_TO_POSIX_ERROR!(B_POSIX_ERROR_BASE + 18);
2008     enum EPROTONOSUPPORT = B_TO_POSIX_ERROR!(B_POSIX_ERROR_BASE + 19);
2009     enum EPFNOSUPPORT    = B_TO_POSIX_ERROR!(B_POSIX_ERROR_BASE + 20);
2010     enum EAFNOSUPPORT    = B_TO_POSIX_ERROR!(B_POSIX_ERROR_BASE + 21);
2011     enum EADDRINUSE      = B_TO_POSIX_ERROR!(B_POSIX_ERROR_BASE + 22);
2012     enum EADDRNOTAVAIL   = B_TO_POSIX_ERROR!(B_POSIX_ERROR_BASE + 23);
2013     enum ENETDOWN        = B_TO_POSIX_ERROR!(B_POSIX_ERROR_BASE + 24);
2014     enum ENETUNREACH     = B_TO_POSIX_ERROR!(B_POSIX_ERROR_BASE + 25);
2015     enum ENETRESET       = B_TO_POSIX_ERROR!(B_POSIX_ERROR_BASE + 26);
2016     enum ECONNABORTED    = B_TO_POSIX_ERROR!(B_POSIX_ERROR_BASE + 27);
2017     enum ECONNRESET      = B_TO_POSIX_ERROR!(B_POSIX_ERROR_BASE + 28);
2018     enum EISCONN         = B_TO_POSIX_ERROR!(B_POSIX_ERROR_BASE + 29);
2019     enum ENOTCONN        = B_TO_POSIX_ERROR!(B_POSIX_ERROR_BASE + 30);
2020     enum ESHUTDOWN       = B_TO_POSIX_ERROR!(B_POSIX_ERROR_BASE + 31);
2021     enum ECONNREFUSED    = B_TO_POSIX_ERROR!(B_POSIX_ERROR_BASE + 32);
2022     enum EHOSTUNREACH    = B_TO_POSIX_ERROR!(B_POSIX_ERROR_BASE + 33);
2023     enum ENOPROTOOPT     = B_TO_POSIX_ERROR!(B_POSIX_ERROR_BASE + 34);
2024     enum ENOBUFS         = B_TO_POSIX_ERROR!(B_POSIX_ERROR_BASE + 35);
2025     enum EINPROGRESS     = B_TO_POSIX_ERROR!(B_POSIX_ERROR_BASE + 36);
2026     enum EALREADY        = B_TO_POSIX_ERROR!(B_POSIX_ERROR_BASE + 37);
2027     enum EILSEQ          = B_TO_POSIX_ERROR!(B_POSIX_ERROR_BASE + 38);
2028     enum ENOMSG          = B_TO_POSIX_ERROR!(B_POSIX_ERROR_BASE + 39);
2029     enum ESTALE          = B_TO_POSIX_ERROR!(B_POSIX_ERROR_BASE + 40);
2030     enum EOVERFLOW       = B_TO_POSIX_ERROR!(B_POSIX_ERROR_BASE + 41);
2031     enum EMSGSIZE        = B_TO_POSIX_ERROR!(B_POSIX_ERROR_BASE + 42);
2032     enum EOPNOTSUPP      = B_TO_POSIX_ERROR!(B_POSIX_ERROR_BASE + 43);
2033     enum ENOTSOCK        = B_TO_POSIX_ERROR!(B_POSIX_ERROR_BASE + 44);
2034     enum EHOSTDOWN       = B_TO_POSIX_ERROR!(B_POSIX_ERROR_BASE + 45);
2035     enum EBADMSG         = B_TO_POSIX_ERROR!(B_POSIX_ERROR_BASE + 46);
2036     enum ECANCELED       = B_TO_POSIX_ERROR!(B_POSIX_ERROR_BASE + 47);
2037     enum EDESTADDRREQ    = B_TO_POSIX_ERROR!(B_POSIX_ERROR_BASE + 48);
2038     enum EDQUOT          = B_TO_POSIX_ERROR!(B_POSIX_ERROR_BASE + 49);
2039     enum EIDRM           = B_TO_POSIX_ERROR!(B_POSIX_ERROR_BASE + 50);
2040     enum EMULTIHOP       = B_TO_POSIX_ERROR!(B_POSIX_ERROR_BASE + 51);
2041     enum ENODATA         = B_TO_POSIX_ERROR!(B_POSIX_ERROR_BASE + 52);
2042     enum ENOLINK         = B_TO_POSIX_ERROR!(B_POSIX_ERROR_BASE + 53);
2043     enum ENOSR           = B_TO_POSIX_ERROR!(B_POSIX_ERROR_BASE + 54);
2044     enum ENOSTR          = B_TO_POSIX_ERROR!(B_POSIX_ERROR_BASE + 55);
2045     enum ENOTSUP         = B_TO_POSIX_ERROR!(B_POSIX_ERROR_BASE + 56);
2046     enum EPROTO          = B_TO_POSIX_ERROR!(B_POSIX_ERROR_BASE + 57);
2047     enum ETIME           = B_TO_POSIX_ERROR!(B_POSIX_ERROR_BASE + 58);
2048     enum ETXTBSY         = B_TO_POSIX_ERROR!(B_POSIX_ERROR_BASE + 59);
2049     enum ENOATTR         = B_TO_POSIX_ERROR!(B_POSIX_ERROR_BASE + 60);
2050 
2051     /* B_NO_MEMORY (0x80000000) can't be negated, so it needs special handling */
2052     static if (B_USE_POSITIVE_POSIX_ERRORS)
2053         enum ENOMEM = B_POSIX_ENOMEM;
2054     else
2055         enum ENOMEM = B_NO_MEMORY;
2056 
2057     /* POSIX errors that can be mapped to BeOS error codes */
2058     enum EACCES          = B_TO_POSIX_ERROR!(B_PERMISSION_DENIED);
2059     enum EINTR           = B_TO_POSIX_ERROR!(B_INTERRUPTED);
2060     enum EIO             = B_TO_POSIX_ERROR!(B_IO_ERROR);
2061     enum EBUSY           = B_TO_POSIX_ERROR!(B_BUSY);
2062     enum EFAULT          = B_TO_POSIX_ERROR!(B_BAD_ADDRESS);
2063     enum ETIMEDOUT       = B_TO_POSIX_ERROR!(B_TIMED_OUT);
2064     enum EAGAIN          = B_TO_POSIX_ERROR!(B_WOULD_BLOCK) /* SysV compatibility */;
2065     enum EWOULDBLOCK     = B_TO_POSIX_ERROR!(B_WOULD_BLOCK) /* BSD compatibility */;
2066     enum EBADF           = B_TO_POSIX_ERROR!(B_FILE_ERROR);
2067     enum EEXIST          = B_TO_POSIX_ERROR!(B_FILE_EXISTS);
2068     enum EINVAL          = B_TO_POSIX_ERROR!(B_BAD_VALUE);
2069     enum ENAMETOOLONG    = B_TO_POSIX_ERROR!(B_NAME_TOO_LONG);
2070     enum ENOENT          = B_TO_POSIX_ERROR!(B_ENTRY_NOT_FOUND);
2071     enum EPERM           = B_TO_POSIX_ERROR!(B_NOT_ALLOWED);
2072     enum ENOTDIR         = B_TO_POSIX_ERROR!(B_NOT_A_DIRECTORY);
2073     enum EISDIR          = B_TO_POSIX_ERROR!(B_IS_A_DIRECTORY);
2074     enum ENOTEMPTY       = B_TO_POSIX_ERROR!(B_DIRECTORY_NOT_EMPTY);
2075     enum ENOSPC          = B_TO_POSIX_ERROR!(B_DEVICE_FULL);
2076     enum EROFS           = B_TO_POSIX_ERROR!(B_READ_ONLY_DEVICE);
2077     enum EMFILE          = B_TO_POSIX_ERROR!(B_NO_MORE_FDS);
2078     enum EXDEV           = B_TO_POSIX_ERROR!(B_CROSS_DEVICE_LINK);
2079     enum ELOOP           = B_TO_POSIX_ERROR!(B_LINK_LIMIT);
2080     enum ENOEXEC         = B_TO_POSIX_ERROR!(B_NOT_AN_EXECUTABLE);
2081     enum EPIPE           = B_TO_POSIX_ERROR!(B_BUSTED_PIPE);
2082 
2083     /* new error codes that can be mapped to POSIX errors */
2084     enum B_BUFFER_OVERFLOW          =  B_FROM_POSIX_ERROR!(EOVERFLOW);
2085     enum B_TOO_MANY_ARGS            =  B_FROM_POSIX_ERROR!(E2BIG);
2086     enum B_FILE_TOO_LARGE           =  B_FROM_POSIX_ERROR!(EFBIG);
2087     enum B_RESULT_NOT_REPRESENTABLE =  B_FROM_POSIX_ERROR!(ERANGE);
2088     enum B_DEVICE_NOT_FOUND         =  B_FROM_POSIX_ERROR!(ENODEV);
2089     enum B_NOT_SUPPORTED            =  B_FROM_POSIX_ERROR!(EOPNOTSUPP);
2090 
2091     /* Media Kit Errors */
2092     enum B_STREAM_NOT_FOUND              = (B_MEDIA_ERROR_BASE + 0);
2093     enum B_SERVER_NOT_FOUND              = (B_MEDIA_ERROR_BASE + 1);
2094     enum B_RESOURCE_NOT_FOUND            = (B_MEDIA_ERROR_BASE + 2);
2095     enum B_RESOURCE_UNAVAILABLE          = (B_MEDIA_ERROR_BASE + 3);
2096     enum B_BAD_SUBSCRIBER                = (B_MEDIA_ERROR_BASE + 4);
2097     enum B_SUBSCRIBER_NOT_ENTERED        = (B_MEDIA_ERROR_BASE + 5);
2098     enum B_BUFFER_NOT_AVAILABLE          = (B_MEDIA_ERROR_BASE + 6);
2099     enum B_LAST_BUFFER_ERROR             = (B_MEDIA_ERROR_BASE + 7);
2100 
2101     enum B_MEDIA_SYSTEM_FAILURE          = (B_MEDIA_ERROR_BASE + 100);
2102     enum B_MEDIA_BAD_NODE                = (B_MEDIA_ERROR_BASE + 101);
2103     enum B_MEDIA_NODE_BUSY               = (B_MEDIA_ERROR_BASE + 102);
2104     enum B_MEDIA_BAD_FORMAT              = (B_MEDIA_ERROR_BASE + 103);
2105     enum B_MEDIA_BAD_BUFFER              = (B_MEDIA_ERROR_BASE + 104);
2106     enum B_MEDIA_TOO_MANY_NODES          = (B_MEDIA_ERROR_BASE + 105);
2107     enum B_MEDIA_TOO_MANY_BUFFERS        = (B_MEDIA_ERROR_BASE + 106);
2108     enum B_MEDIA_NODE_ALREADY_EXISTS     = (B_MEDIA_ERROR_BASE + 107);
2109     enum B_MEDIA_BUFFER_ALREADY_EXISTS   = (B_MEDIA_ERROR_BASE + 108);
2110     enum B_MEDIA_CANNOT_SEEK             = (B_MEDIA_ERROR_BASE + 109);
2111     enum B_MEDIA_CANNOT_CHANGE_RUN_MODE  = (B_MEDIA_ERROR_BASE + 110);
2112     enum B_MEDIA_APP_ALREADY_REGISTERED  = (B_MEDIA_ERROR_BASE + 111);
2113     enum B_MEDIA_APP_NOT_REGISTERED      = (B_MEDIA_ERROR_BASE + 112);
2114     enum B_MEDIA_CANNOT_RECLAIM_BUFFERS  = (B_MEDIA_ERROR_BASE + 113);
2115     enum B_MEDIA_BUFFERS_NOT_RECLAIMED   = (B_MEDIA_ERROR_BASE + 114);
2116     enum B_MEDIA_TIME_SOURCE_STOPPED     = (B_MEDIA_ERROR_BASE + 115);
2117     enum B_MEDIA_TIME_SOURCE_BUSY        = (B_MEDIA_ERROR_BASE + 116);
2118     enum B_MEDIA_BAD_SOURCE              = (B_MEDIA_ERROR_BASE + 117);
2119     enum B_MEDIA_BAD_DESTINATION         = (B_MEDIA_ERROR_BASE + 118);
2120     enum B_MEDIA_ALREADY_CONNECTED       = (B_MEDIA_ERROR_BASE + 119);
2121     enum B_MEDIA_NOT_CONNECTED           = (B_MEDIA_ERROR_BASE + 120);
2122     enum B_MEDIA_BAD_CLIP_FORMAT         = (B_MEDIA_ERROR_BASE + 121);
2123     enum B_MEDIA_ADDON_FAILED            = (B_MEDIA_ERROR_BASE + 122);
2124     enum B_MEDIA_ADDON_DISABLED          = (B_MEDIA_ERROR_BASE + 123);
2125     enum B_MEDIA_CHANGE_IN_PROGRESS      = (B_MEDIA_ERROR_BASE + 124);
2126     enum B_MEDIA_STALE_CHANGE_COUNT      = (B_MEDIA_ERROR_BASE + 125);
2127     enum B_MEDIA_ADDON_RESTRICTED        = (B_MEDIA_ERROR_BASE + 126);
2128     enum B_MEDIA_NO_HANDLER              = (B_MEDIA_ERROR_BASE + 127);
2129     enum B_MEDIA_DUPLICATE_FORMAT        = (B_MEDIA_ERROR_BASE + 128);
2130     enum B_MEDIA_REALTIME_DISABLED       = (B_MEDIA_ERROR_BASE + 129);
2131     enum B_MEDIA_REALTIME_UNAVAILABLE    = (B_MEDIA_ERROR_BASE + 130);
2132 
2133     /* Mail Kit Errors */
2134     enum B_MAIL_NO_DAEMON                = (B_MAIL_ERROR_BASE + 0);
2135     enum B_MAIL_UNKNOWN_USER             = (B_MAIL_ERROR_BASE + 1);
2136     enum B_MAIL_WRONG_PASSWORD           = (B_MAIL_ERROR_BASE + 2);
2137     enum B_MAIL_UNKNOWN_HOST             = (B_MAIL_ERROR_BASE + 3);
2138     enum B_MAIL_ACCESS_ERROR             = (B_MAIL_ERROR_BASE + 4);
2139     enum B_MAIL_UNKNOWN_FIELD            = (B_MAIL_ERROR_BASE + 5);
2140     enum B_MAIL_NO_RECIPIENT             = (B_MAIL_ERROR_BASE + 6);
2141     enum B_MAIL_INVALID_MAIL             = (B_MAIL_ERROR_BASE + 7);
2142 
2143     /* Printing Errors */
2144     enum B_NO_PRINT_SERVER               = (B_PRINT_ERROR_BASE + 0);
2145 
2146     /* Device Kit Errors */
2147     enum B_DEV_INVALID_IOCTL             = (B_DEVICE_ERROR_BASE + 0);
2148     enum B_DEV_NO_MEMORY                 = (B_DEVICE_ERROR_BASE + 1);
2149     enum B_DEV_BAD_DRIVE_NUM             = (B_DEVICE_ERROR_BASE + 2);
2150     enum B_DEV_NO_MEDIA                  = (B_DEVICE_ERROR_BASE + 3);
2151     enum B_DEV_UNREADABLE                = (B_DEVICE_ERROR_BASE + 4);
2152     enum B_DEV_FORMAT_ERROR              = (B_DEVICE_ERROR_BASE + 5);
2153     enum B_DEV_TIMEOUT                   = (B_DEVICE_ERROR_BASE + 6);
2154     enum B_DEV_RECALIBRATE_ERROR         = (B_DEVICE_ERROR_BASE + 7);
2155     enum B_DEV_SEEK_ERROR                = (B_DEVICE_ERROR_BASE + 8);
2156     enum B_DEV_ID_ERROR                  = (B_DEVICE_ERROR_BASE + 9);
2157     enum B_DEV_READ_ERROR                = (B_DEVICE_ERROR_BASE + 10);
2158     enum B_DEV_WRITE_ERROR               = (B_DEVICE_ERROR_BASE + 11);
2159     enum B_DEV_NOT_READY                 = (B_DEVICE_ERROR_BASE + 12);
2160     enum B_DEV_MEDIA_CHANGED             = (B_DEVICE_ERROR_BASE + 13);
2161     enum B_DEV_MEDIA_CHANGE_REQUESTED    = (B_DEVICE_ERROR_BASE + 14);
2162     enum B_DEV_RESOURCE_CONFLICT         = (B_DEVICE_ERROR_BASE + 15);
2163     enum B_DEV_CONFIGURATION_ERROR       = (B_DEVICE_ERROR_BASE + 16);
2164     enum B_DEV_DISABLED_BY_USER          = (B_DEVICE_ERROR_BASE + 17);
2165     enum B_DEV_DOOR_OPEN                 = (B_DEVICE_ERROR_BASE + 18);
2166 
2167     enum B_DEV_INVALID_PIPE              = (B_DEVICE_ERROR_BASE + 19);
2168     enum B_DEV_CRC_ERROR                 = (B_DEVICE_ERROR_BASE + 20);
2169     enum B_DEV_STALLED                   = (B_DEVICE_ERROR_BASE + 21);
2170     enum B_DEV_BAD_PID                   = (B_DEVICE_ERROR_BASE + 22);
2171     enum B_DEV_UNEXPECTED_PID            = (B_DEVICE_ERROR_BASE + 23);
2172     enum B_DEV_DATA_OVERRUN              = (B_DEVICE_ERROR_BASE + 24);
2173     enum B_DEV_DATA_UNDERRUN             = (B_DEVICE_ERROR_BASE + 25);
2174     enum B_DEV_FIFO_OVERRUN              = (B_DEVICE_ERROR_BASE + 26);
2175     enum B_DEV_FIFO_UNDERRUN             = (B_DEVICE_ERROR_BASE + 27);
2176     enum B_DEV_PENDING                   = (B_DEVICE_ERROR_BASE + 28);
2177     enum B_DEV_MULTIPLE_ERRORS           = (B_DEVICE_ERROR_BASE + 29);
2178     enum B_DEV_TOO_LATE                  = (B_DEVICE_ERROR_BASE + 30);
2179 
2180     /* Translation Kit Errors */
2181     enum B_TRANSLATION_BASE_ERROR        = (B_TRANSLATION_ERROR_BASE + 0);
2182     enum B_NO_TRANSLATOR                 = (B_TRANSLATION_ERROR_BASE + 1);
2183     enum B_ILLEGAL_DATA                  = (B_TRANSLATION_ERROR_BASE + 2);
2184 }
2185 else version (WASI)
2186 {
2187     enum EPERM            = 1;
2188     enum ENOENT           = 2;
2189     enum ESRCH            = 3;
2190     enum EINTR            = 4;
2191     enum EIO              = 5;
2192     enum ENXIO            = 6;
2193     enum E2BIG            = 7;
2194     enum ENOEXEC          = 8;
2195     enum EBADF            = 9;
2196     enum ECHILD          = 10;
2197     enum EAGAIN          = 11;
2198     enum ENOMEM          = 12;
2199     enum EACCES          = 13;
2200     enum EFAULT          = 14;
2201     enum ENOTBLK         = 15;
2202     enum EBUSY           = 16;
2203     enum EEXIST          = 17;
2204     enum EXDEV           = 18;
2205     enum ENODEV          = 19;
2206     enum ENOTDIR         = 20;
2207     enum EISDIR          = 21;
2208     enum EINVAL          = 22;
2209     enum ENFILE          = 23;
2210     enum EMFILE          = 24;
2211     enum ENOTTY          = 25;
2212     enum ETXTBSY         = 26;
2213     enum EFBIG           = 27;
2214     enum ENOSPC          = 28;
2215     enum ESPIPE          = 29;
2216     enum EROFS           = 30;
2217     enum EMLINK          = 31;
2218     enum EPIPE           = 32;
2219     enum EDOM            = 33;
2220     enum ERANGE          = 34;
2221     enum EDEADLK         = 35;
2222     enum ENAMETOOLONG    = 36;
2223     enum ENOLCK          = 37;
2224     enum ENOSYS          = 38;
2225     enum ENOTEMPTY       = 39;
2226     enum ELOOP           = 40;
2227     enum EWOULDBLOCK     = EAGAIN;
2228     enum ENOMSG          = 42;
2229     enum EIDRM           = 43;
2230     enum ECHRNG          = 44;
2231     enum EL2NSYNC        = 45;
2232     enum EL3HLT          = 46;
2233     enum EL3RST          = 47;
2234     enum ELNRNG          = 48;
2235     enum EUNATCH         = 49;
2236     enum ENOCSI          = 50;
2237     enum EL2HLT          = 51;
2238     enum EBADE           = 52;
2239     enum EBADR           = 53;
2240     enum EXFULL          = 54;
2241     enum ENOANO          = 55;
2242     enum EBADRQC         = 56;
2243     enum EBADSLT         = 57;
2244     enum EDEADLOCK       = EDEADLK;
2245     enum EBFONT          = 59;
2246     enum ENOSTR          = 60;
2247     enum ENODATA         = 61;
2248     enum ETIME           = 62;
2249     enum ENOSR           = 63;
2250     enum ENONET          = 64;
2251     enum ENOPKG          = 65;
2252     enum EREMOTE         = 66;
2253     enum ENOLINK         = 67;
2254     enum EADV            = 68;
2255     enum ESRMNT          = 69;
2256     enum ECOMM           = 70;
2257     enum EPROTO          = 71;
2258     enum EMULTIHOP       = 72;
2259     enum EDOTDOT         = 73;
2260     enum EBADMSG         = 74;
2261     enum EOVERFLOW       = 75;
2262     enum ENOTUNIQ        = 76;
2263     enum EBADFD          = 77;
2264     enum EREMCHG         = 78;
2265     enum ELIBACC         = 79;
2266     enum ELIBBAD         = 80;
2267     enum ELIBSCN         = 81;
2268     enum ELIBMAX         = 82;
2269     enum ELIBEXEC        = 83;
2270     enum EILSEQ          = 84;
2271     enum ERESTART        = 85;
2272     enum ESTRPIPE        = 86;
2273     enum EUSERS          = 87;
2274     enum ENOTSOCK        = 88;
2275     enum EDESTADDRREQ    = 89;
2276     enum EMSGSIZE        = 90;
2277     enum EPROTOTYPE      = 91;
2278     enum ENOPROTOOPT     = 92;
2279     enum EPROTONOSUPPORT = 93;
2280     enum ESOCKTNOSUPPORT = 94;
2281     enum EOPNOTSUPP      = 95;
2282     enum ENOTSUP         = EOPNOTSUPP;
2283     enum EPFNOSUPPORT    = 96;
2284     enum EAFNOSUPPORT    = 97;
2285     enum EADDRINUSE      = 98;
2286     enum EADDRNOTAVAIL   = 99;
2287     enum ENETDOWN        = 100;
2288     enum ENETUNREACH     = 101;
2289     enum ENETRESET       = 102;
2290     enum ECONNABORTED    = 103;
2291     enum ECONNRESET      = 104;
2292     enum ENOBUFS         = 105;
2293     enum EISCONN         = 106;
2294     enum ENOTCONN        = 107;
2295     enum ESHUTDOWN       = 108;
2296     enum ETOOMANYREFS    = 109;
2297     enum ETIMEDOUT       = 110;
2298     enum ECONNREFUSED    = 111;
2299     enum EHOSTDOWN       = 112;
2300     enum EHOSTUNREACH    = 113;
2301     enum EALREADY        = 114;
2302     enum EINPROGRESS     = 115;
2303     enum ESTALE          = 116;
2304     enum EUCLEAN         = 117;
2305     enum ENOTNAM         = 118;
2306     enum ENAVAIL         = 119;
2307     enum EISNAM          = 120;
2308     enum EREMOTEIO       = 121;
2309     enum EDQUOT          = 122;
2310     enum ENOMEDIUM       = 123;
2311     enum EMEDIUMTYPE     = 124;
2312     enum ECANCELED       = 125;
2313     enum ENOKEY          = 126;
2314     enum EKEYEXPIRED     = 127;
2315     enum EKEYREVOKED     = 128;
2316     enum EKEYREJECTED    = 129;
2317     enum EOWNERDEAD      = 130;
2318     enum ENOTRECOVERABLE = 131;
2319     enum ERFKILL         = 132;
2320     enum EHWPOISON       = 133;
2321 }
2322 else
2323 {
2324     static assert(false, "Unsupported platform");
2325 }