1pub const EPERM: i32 = 1;
3
4pub const ENOENT: i32 = 2;
6
7pub const ESRCH: i32 = 3;
9
10pub const EINTR: i32 = 4;
12
13pub const EIO: i32 = 5;
15
16pub const ENXIO: i32 = 6;
18
19pub const E2BIG: i32 = 7;
21
22pub const ENOEXEC: i32 = 8;
24
25pub const EBADF: i32 = 9;
27
28pub const ECHILD: i32 = 10;
30
31pub const EAGAIN: i32 = 11;
33
34pub const ENOMEM: i32 = 12;
36
37pub const EACCES: i32 = 13;
39
40pub const EFAULT: i32 = 14;
42
43pub const ENOTBLK: i32 = 15;
45
46pub const EBUSY: i32 = 16;
48
49pub const EEXIST: i32 = 17;
51
52pub const EXDEV: i32 = 18;
54
55pub const ENODEV: i32 = 19;
57
58pub const ENOTDIR: i32 = 20;
60
61pub const EISDIR: i32 = 21;
63
64pub const EINVAL: i32 = 22;
66
67pub const ENFILE: i32 = 23;
69
70pub const EMFILE: i32 = 24;
72
73pub const ENOTTY: i32 = 25;
75
76pub const ETXTBSY: i32 = 26;
78
79pub const EFBIG: i32 = 27;
81
82pub const ENOSPC: i32 = 28;
84
85pub const ESPIPE: i32 = 29;
87
88pub const EROFS: i32 = 30;
90
91pub const EMLINK: i32 = 31;
93
94pub const EPIPE: i32 = 32;
96
97pub const EDOM: i32 = 33;
99
100pub const ERANGE: i32 = 34;
102
103pub const EDEADLK: i32 = 35;
105
106pub const ENAMETOOLONG: i32 = 36;
108
109pub const ENOLCK: i32 = 37;
111
112pub const ENOSYS: i32 = 38;
114
115pub const ENOTEMPTY: i32 = 39;
117
118pub const ELOOP: i32 = 40;
120
121pub const EWOULDBLOCK: i32 = EAGAIN;
123
124pub const ENOMSG: i32 = 42;
126
127pub const EIDRM: i32 = 43;
129
130pub const ECHRNG: i32 = 44;
132
133pub const EL2NSYNC: i32 = 45;
135
136pub const EL3HLT: i32 = 46;
138
139pub const EL3RST: i32 = 47;
141
142pub const ELNRNG: i32 = 48;
144
145pub const EUNATCH: i32 = 49;
147
148pub const ENOCSI: i32 = 50;
150
151pub const EL2HLT: i32 = 51;
153
154pub const EBADE: i32 = 52;
156
157pub const EBADR: i32 = 53;
159
160pub const EXFULL: i32 = 54;
162
163pub const ENOANO: i32 = 55;
165
166pub const EBADRQC: i32 = 56;
168
169pub const EBADSLT: i32 = 57;
171
172pub const EDEADLOCK: i32 = EDEADLK;
173
174pub const EBFONT: i32 = 59;
176
177pub const ENOSTR: i32 = 60;
179
180pub const ENODATA: i32 = 61;
182
183pub const ETIME: i32 = 62;
185
186pub const ENOSR: i32 = 63;
188
189pub const ENONET: i32 = 64;
191
192pub const ENOPKG: i32 = 65;
194
195pub const EREMOTE: i32 = 66;
197
198pub const ENOLINK: i32 = 67;
200
201pub const EADV: i32 = 68;
203
204pub const ESRMNT: i32 = 69;
206
207pub const ECOMM: i32 = 70;
209
210pub const EPROTO: i32 = 71;
212
213pub const EMULTIHOP: i32 = 72;
215
216pub const EDOTDOT: i32 = 73;
218
219pub const EBADMSG: i32 = 74;
221
222pub const EOVERFLOW: i32 = 75;
224
225pub const ENOTUNIQ: i32 = 76;
227
228pub const EBADFD: i32 = 77;
230
231pub const EREMCHG: i32 = 78;
233
234pub const ELIBACC: i32 = 79;
236
237pub const ELIBBAD: i32 = 80;
239
240pub const ELIBSCN: i32 = 81;
242
243pub const ELIBMAX: i32 = 82;
245
246pub const ELIBEXEC: i32 = 83;
248
249pub const EILSEQ: i32 = 84;
251
252pub const ERESTART: i32 = 85;
254
255pub const ESTRPIPE: i32 = 86;
257
258pub const EUSERS: i32 = 87;
260
261pub const ENOTSOCK: i32 = 88;
263
264pub const EDESTADDRREQ: i32 = 89;
266
267pub const EMSGSIZE: i32 = 90;
269
270pub const EPROTOTYPE: i32 = 91;
272
273pub const ENOPROTOOPT: i32 = 92;
275
276pub const EPROTONOSUPPORT: i32 = 93;
278
279pub const ESOCKTNOSUPPORT: i32 = 94;
281
282pub const EOPNOTSUPP: i32 = 95;
284
285pub const EPFNOSUPPORT: i32 = 96;
287
288pub const EAFNOSUPPORT: i32 = 97;
290
291pub const EADDRINUSE: i32 = 98;
293
294pub const EADDRNOTAVAIL: i32 = 99;
296
297pub const ENETDOWN: i32 = 100;
299
300pub const ENETUNREACH: i32 = 101;
302
303pub const ENETRESET: i32 = 102;
305
306pub const ECONNABORTED: i32 = 103;
308
309pub const ECONNRESET: i32 = 104;
311
312pub const ENOBUFS: i32 = 105;
314
315pub const EISCONN: i32 = 106;
317
318pub const ENOTCONN: i32 = 107;
320
321pub const ESHUTDOWN: i32 = 108;
323
324pub const ETOOMANYREFS: i32 = 109;
326
327pub const ETIMEDOUT: i32 = 110;
329
330pub const ECONNREFUSED: i32 = 111;
332
333pub const EHOSTDOWN: i32 = 112;
335
336pub const EHOSTUNREACH: i32 = 113;
338
339pub const EALREADY: i32 = 114;
341
342pub const EINPROGRESS: i32 = 115;
344
345pub const ESTALE: i32 = 116;
347
348pub const EUCLEAN: i32 = 117;
350
351pub const ENOTNAM: i32 = 118;
353
354pub const ENAVAIL: i32 = 119;
356
357pub const EISNAM: i32 = 120;
359
360pub const EREMOTEIO: i32 = 121;
362
363pub const EDQUOT: i32 = 122;
365
366pub const ENOMEDIUM: i32 = 123;
368
369pub const EMEDIUMTYPE: i32 = 124;
371
372pub const ECANCELED: i32 = 125;
374
375pub const ENOKEY: i32 = 126;
377
378pub const EKEYEXPIRED: i32 = 127;
380
381pub const EKEYREVOKED: i32 = 128;
383
384pub const EKEYREJECTED: i32 = 129;
386
387pub const EOWNERDEAD: i32 = 130;
389
390pub const ENOTRECOVERABLE: i32 = 131;
392
393pub const ERFKILL: i32 = 132;
395
396pub const EHWPOISON: i32 = 133;
398
399pub fn error_string(errno: i32) -> &'static str {
401 match errno {
402 0 => "Operation successful",
403 EPERM => "Operation not permitted",
404 ENOENT => "No such file or directory",
405 ESRCH => "No such process",
406 EINTR => "Interrupted system call",
407 EIO => "I/O error",
408 ENXIO => "No such device or address",
409 E2BIG => "Argument list too long",
410 ENOEXEC => "Exec format error",
411 EBADF => "Bad file number",
412 ECHILD => "No child processes",
413 EAGAIN => "Try again",
414 ENOMEM => "Out of memory",
415 EACCES => "Permission denied",
416 EFAULT => "Bad address",
417 ENOTBLK => "Block device required",
418 EBUSY => "Device or resource busy",
419 EEXIST => "File exists",
420 EXDEV => "Cross-device link",
421 ENODEV => "No such device",
422 ENOTDIR => "Not a directory",
423 EISDIR => "Is a directory",
424 EINVAL => "Invalid argument",
425 ENFILE => "File table overflow",
426 EMFILE => "Too many open files",
427 ENOTTY => "Not a typewriter",
428 ETXTBSY => "Text file busy",
429 EFBIG => "File too large",
430 ENOSPC => "No space left on device",
431 ESPIPE => "Illegal seek",
432 EROFS => "Read-only file system",
433 EMLINK => "Too many links",
434 EPIPE => "Broken pipe",
435 EDOM => "Math argument out of domain of func",
436 ERANGE => "Math result not representable",
437 EDEADLK => "Resource deadlock would occur",
438 ENAMETOOLONG => "File name too long",
439 ENOLCK => "No record locks available",
440 ENOSYS => "Function not implemented",
441 ENOTEMPTY => "Directory not empty",
442 ELOOP => "Too many symbolic links encountered",
443 ENOMSG => "No message of desired type",
444 EIDRM => "Identifier removed",
445 ECHRNG => "Channel number out of range",
446 EL2NSYNC => "Level 2 not synchronized",
447 EL3HLT => "Level 3 halted",
448 EL3RST => "Level 3 reset",
449 ELNRNG => "Link number out of range",
450 EUNATCH => "Protocol driver not attached",
451 ENOCSI => "No CSI structure available",
452 EL2HLT => "Level 2 halted",
453 EBADE => "Invalid exchange",
454 EBADR => "Invalid request descriptor",
455 EXFULL => "Exchange full",
456 ENOANO => "No anode",
457 EBADRQC => "Invalid request code",
458 EBADSLT => "Invalid slot",
459 EBFONT => "Bad font file format",
460 ENOSTR => "Device not a stream",
461 ENODATA => "No data available",
462 ETIME => "Timer expired",
463 ENOSR => "Out of streams resources",
464 ENONET => "Machine is not on the network",
465 ENOPKG => "Package not installed",
466 EREMOTE => "Object is remote",
467 ENOLINK => "Link has been severed",
468 EADV => "Advertise error",
469 ESRMNT => "Srmount error",
470 ECOMM => "Communication error on send",
471 EPROTO => "Protocol error",
472 EMULTIHOP => "Multihop attempted",
473 EDOTDOT => "RFS specific error",
474 EBADMSG => "Not a data message",
475 EOVERFLOW => "Value too large for defined data type",
476 ENOTUNIQ => "Name not unique on network",
477 EBADFD => "File descriptor in bad state",
478 EREMCHG => "Remote address changed",
479 ELIBACC => "Can not access a needed shared library",
480 ELIBBAD => "Accessing a corrupted shared library",
481 ELIBSCN => "Lib section in a.out corrupted",
482 ELIBMAX => "Attempting to link in too many shared libraries",
483 ELIBEXEC => "Cannot exec a shared library directly",
484 EILSEQ => "Illegal byte sequence",
485 ERESTART => "Interrupted system call should be restarted",
486 ESTRPIPE => "Streams pipe error",
487 EUSERS => "Too many users",
488 ENOTSOCK => "Socket operation on non-socket",
489 EDESTADDRREQ => "Destination address required",
490 EMSGSIZE => "Message too long",
491 EPROTOTYPE => "Protocol wrong type for socket",
492 ENOPROTOOPT => "Protocol not available",
493 EPROTONOSUPPORT => "Protocol not supported",
494 ESOCKTNOSUPPORT => "Socket type not supported",
495 EOPNOTSUPP => "Operation not supported on transport endpoint",
496 EPFNOSUPPORT => "Protocol family not supported",
497 EAFNOSUPPORT => "Address family not supported by protocol",
498 EADDRINUSE => "Address already in use",
499 EADDRNOTAVAIL => "Cannot assign requested address",
500 ENETDOWN => "Network is down",
501 ENETUNREACH => "Network is unreachable",
502 ENETRESET => "Network dropped connection because of reset",
503 ECONNABORTED => "Software caused connection abort",
504 ECONNRESET => "Connection reset by peer",
505 ENOBUFS => "No buffer space available",
506 EISCONN => "Transport endpoint is already connected",
507 ENOTCONN => "Transport endpoint is not connected",
508 ESHUTDOWN => "Cannot send after transport endpoint shutdown",
509 ETOOMANYREFS => "Too many references: cannot splice",
510 ETIMEDOUT => "Connection timed out",
511 ECONNREFUSED => "Connection refused",
512 EHOSTDOWN => "Host is down",
513 EHOSTUNREACH => "No route to host",
514 EALREADY => "Operation already in progress",
515 EINPROGRESS => "Operation now in progress",
516 ESTALE => "Stale file handle",
517 EUCLEAN => "Structure needs cleaning",
518 EDQUOT => "Quota exceeded",
519 ENOMEDIUM => "No medium found",
520 EMEDIUMTYPE => "Wrong medium type",
521 ECANCELED => "Operation Canceled",
522 ENOKEY => "Required key not available",
523 EKEYEXPIRED => "Key has expired",
524 EKEYREVOKED => "Key has been revoked",
525 EKEYREJECTED => "Key was rejected by service",
526 EOWNERDEAD => "Robust mutexes: Owner died",
527 ENOTRECOVERABLE => "Robust mutexes: State not recoverable",
528 ERFKILL => "Robust mutexes: Operation not possible due to RF-kill",
529 EHWPOISON => "Robust mutexes: Memory page has hardware error",
530 _ => "Unknown error",
531 }
532}