13
13
// FIXME: Only defining POSIXErrorCode for Darwin and Linux at the moment.
14
14
15
15
#if os(OSX) || os(iOS) || os(tvOS) || os(watchOS)
16
+
16
17
/// Enumeration describing POSIX error codes.
17
18
@objc public enum POSIXErrorCode : Int32 {
18
19
/// Operation not permitted.
91
92
/// Resource temporarily unavailable.
92
93
case EAGAIN = 35
93
94
/// Operation would block.
94
- public static var EWOULDBLOCK : POSIXErrorCode { return EAGAIN }
95
+ public static var EWOULDBLOCK : POSIXErrorCode { return EAGAIN }
95
96
/// Operation now in progress.
96
97
case EINPROGRESS = 36
97
98
/// Operation already in progress.
205
206
206
207
/// Value too large to be stored in data type.
207
208
case EOVERFLOW = 84
208
-
209
- /// Program loading errors.
209
+
210
+ // MARK: Program loading errors.
211
+
210
212
/// Bad executable.
211
213
case EBADEXEC = 85
212
214
/// Bad CPU type in executable.
@@ -330,8 +332,7 @@ public enum POSIXErrorCode : Int32 {
330
332
case EMLINK = 31
331
333
/// Broken pipe.
332
334
case EPIPE = 32
333
-
334
- /// math software.
335
+
335
336
/// Numerical argument out of domain.
336
337
case EDOM = 33
337
338
/// Result too large.
@@ -356,8 +357,8 @@ public enum POSIXErrorCode : Int32 {
356
357
case ELOOP = 40
357
358
358
359
/// Operation would block.
359
- public static var EWOULDBLOCK : POSIXErrorCode { return . EAGAIN }
360
-
360
+ public static var EWOULDBLOCK : POSIXErrorCode { return . EAGAIN }
361
+
361
362
/// No message of desired type.
362
363
case ENOMSG = 42
363
364
@@ -387,91 +388,169 @@ public enum POSIXErrorCode : Int32 {
387
388
388
389
/// Level 2 halted.
389
390
case EL2HLT = 51
390
- case EBADE = 52 /* Invalid exchange */
391
- case EBADR = 53 /* Invalid request descriptor */
392
- case EXFULL = 54 /* Exchange full */
393
- case ENOANO = 55 /* No anode */
394
- case EBADRQC = 56 /* Invalid request code */
395
- case EBADSLT = 57 /* Invalid slot */
396
-
397
- public static var EDEADLOCK : POSIXErrorCode { return . EDEADLK }
398
-
399
- case EBFONT = 59 /* Bad font file format */
400
- case ENOSTR = 60 /* Device not a stream */
401
- case ENODATA = 61 /* No data available */
402
- case ETIME = 62 /* Timer expired */
403
- case ENOSR = 63 /* Out of streams resources */
404
- case ENONET = 64 /* Machine is not on the network */
405
- case ENOPKG = 65 /* Package not installed */
406
- case EREMOTE = 66 /* Object is remote */
407
- case ENOLINK = 67 /* Link has been severed */
408
- case EADV = 68 /* Advertise error */
409
- case ESRMNT = 69 /* Srmount error */
410
- case ECOMM = 70 /* Communication error on send */
411
- case EPROTO = 71 /* Protocol error */
412
- case EMULTIHOP = 72 /* Multihop attempted */
413
- case EDOTDOT = 73 /* RFS specific error */
414
- case EBADMSG = 74 /* Not a data message */
415
- case EOVERFLOW = 75 /* Value too large for defined data type */
416
- case ENOTUNIQ = 76 /* Name not unique on network */
417
- case EBADFD = 77 /* File descriptor in bad state */
418
- case EREMCHG = 78 /* Remote address changed */
419
- case ELIBACC = 79 /* Can not access a needed shared library */
420
- case ELIBBAD = 80 /* Accessing a corrupted shared library */
421
- case ELIBSCN = 81 /* .lib section in a.out corrupted */
422
- case ELIBMAX = 82 /* Attempting to link in too many shared libraries */
423
- case ELIBEXEC = 83 /* Cannot exec a shared library directly */
424
- case EILSEQ = 84 /* Illegal byte sequence */
425
- case ERESTART = 85 /* Interrupted system call should be restarted */
426
- case ESTRPIPE = 86 /* Streams pipe error */
427
- case EUSERS = 87 /* Too many users */
428
- case ENOTSOCK = 88 /* Socket operation on non-socket */
429
- case EDESTADDRREQ = 89 /* Destination address required */
430
- case EMSGSIZE = 90 /* Message too long */
431
- case EPROTOTYPE = 91 /* Protocol wrong type for socket */
432
- case ENOPROTOOPT = 92 /* Protocol not available */
433
- case EPROTONOSUPPORT = 93 /* Protocol not supported */
434
- case ESOCKTNOSUPPORT = 94 /* Socket type not supported */
435
- case EOPNOTSUPP = 95 /* Operation not supported on transport endpoint */
436
- case EPFNOSUPPORT = 96 /* Protocol family not supported */
437
- case EAFNOSUPPORT = 97 /* Address family not supported by protocol */
438
- case EADDRINUSE = 98 /* Address already in use */
439
- case EADDRNOTAVAIL = 99 /* Cannot assign requested address */
440
- case ENETDOWN = 100 /* Network is down */
441
- case ENETUNREACH = 101 /* Network is unreachable */
442
- case ENETRESET = 102 /* Network dropped connection because of reset */
443
- case ECONNABORTED = 103 /* Software caused connection abort */
444
- case ECONNRESET = 104 /* Connection reset by peer */
445
- case ENOBUFS = 105 /* No buffer space available */
446
- case EISCONN = 106 /* Transport endpoint is already connected */
447
- case ENOTCONN = 107 /* Transport endpoint is not connected */
448
- case ESHUTDOWN = 108 /* Cannot send after transport endpoint shutdown */
449
- case ETOOMANYREFS = 109 /* Too many references: cannot splice */
450
- case ETIMEDOUT = 110 /* Connection timed out */
451
- case ECONNREFUSED = 111 /* Connection refused */
452
- case EHOSTDOWN = 112 /* Host is down */
453
- case EHOSTUNREACH = 113 /* No route to host */
454
- case EALREADY = 114 /* Operation already in progress */
455
- case EINPROGRESS = 115 /* Operation now in progress */
456
- case ESTALE = 116 /* Stale NFS file handle */
457
- case EUCLEAN = 117 /* Structure needs cleaning */
458
- case ENOTNAM = 118 /* Not a XENIX named type file */
459
- case ENAVAIL = 119 /* No XENIX semaphores available */
460
- case EISNAM = 120 /* Is a named type file */
461
- case EREMOTEIO = 121 /* Remote I/O error */
462
- case EDQUOT = 122 /* Quota exceeded */
463
-
464
- case ENOMEDIUM = 123 /* No medium found */
465
- case EMEDIUMTYPE = 124 /* Wrong medium type */
466
- case ECANCELED = 125 /* Operation Canceled */
467
- case ENOKEY = 126 /* Required key not available */
468
- case EKEYEXPIRED = 127 /* Key has expired */
469
- case EKEYREVOKED = 128 /* Key has been revoked */
470
- case EKEYREJECTED = 129 /* Key was rejected by service */
471
-
472
- /* for robust mutexes */
473
- case EOWNERDEAD = 130 /* Owner died */
474
- case ENOTRECOVERABLE = 131 /* State not recoverable */
391
+ /// Invalid exchange
392
+ case EBADE = 52
393
+ /// Invalid request descriptor
394
+ case EBADR = 53
395
+ /// Exchange full
396
+ case EXFULL = 54
397
+ /// No anode
398
+ case ENOANO = 55
399
+ /// Invalid request code
400
+ case EBADRQC = 56
401
+ /// Invalid slot
402
+ case EBADSLT = 57
403
+
404
+ public static var EDEADLOCK : POSIXErrorCode { return . EDEADLK }
405
+
406
+ /// Bad font file format
407
+ case EBFONT = 59
408
+ /// Device not a stream
409
+ case ENOSTR = 60
410
+ /// No data available
411
+ case ENODATA = 61
412
+ /// Timer expired
413
+ case ETIME = 62
414
+ /// Out of streams resources
415
+ case ENOSR = 63
416
+ /// Machine is not on the network
417
+ case ENONET = 64
418
+ /// Package not installed
419
+ case ENOPKG = 65
420
+ /// Object is remote
421
+ case EREMOTE = 66
422
+ /// Link has been severed
423
+ case ENOLINK = 67
424
+ /// Advertise error
425
+ case EADV = 68
426
+ /// Srmount error
427
+ case ESRMNT = 69
428
+ /// Communication error on send
429
+ case ECOMM = 70
430
+ /// Protocol error
431
+ case EPROTO = 71
432
+ /// Multihop attempted
433
+ case EMULTIHOP = 72
434
+ /// RFS specific error
435
+ case EDOTDOT = 73
436
+ /// Not a data message
437
+ case EBADMSG = 74
438
+ /// Value too large for defined data type
439
+ case EOVERFLOW = 75
440
+ /// Name not unique on network
441
+ case ENOTUNIQ = 76
442
+ /// File descriptor in bad state
443
+ case EBADFD = 77
444
+ /// Remote address changed
445
+ case EREMCHG = 78
446
+ /// Can not access a needed shared library
447
+ case ELIBACC = 79
448
+ /// Accessing a corrupted shared library
449
+ case ELIBBAD = 80
450
+ /// .lib section in a.out corrupted
451
+ case ELIBSCN = 81
452
+ /// Attempting to link in too many shared libraries
453
+ case ELIBMAX = 82
454
+ /// Cannot exec a shared library directly
455
+ case ELIBEXEC = 83
456
+ /// Illegal byte sequence
457
+ case EILSEQ = 84
458
+ /// Interrupted system call should be restarted
459
+ case ERESTART = 85
460
+ /// Streams pipe error
461
+ case ESTRPIPE = 86
462
+ /// Too many users
463
+ case EUSERS = 87
464
+ /// Socket operation on non-socket
465
+ case ENOTSOCK = 88
466
+ /// Destination address required
467
+ case EDESTADDRREQ = 89
468
+ /// Message too long
469
+ case EMSGSIZE = 90
470
+ /// Protocol wrong type for socket
471
+ case EPROTOTYPE = 91
472
+ /// Protocol not available
473
+ case ENOPROTOOPT = 92
474
+ /// Protocol not supported
475
+ case EPROTONOSUPPORT = 93
476
+ /// Socket type not supported
477
+ case ESOCKTNOSUPPORT = 94
478
+ /// Operation not supported on transport endpoint
479
+ case EOPNOTSUPP = 95
480
+ /// Protocol family not supported
481
+ case EPFNOSUPPORT = 96
482
+ /// Address family not supported by protocol
483
+ case EAFNOSUPPORT = 97
484
+ /// Address already in use
485
+ case EADDRINUSE = 98
486
+ /// Cannot assign requested address
487
+ case EADDRNOTAVAIL = 99
488
+ /// Network is down
489
+ case ENETDOWN = 100
490
+ /// Network is unreachable
491
+ case ENETUNREACH = 101
492
+ /// Network dropped connection because of reset
493
+ case ENETRESET = 102
494
+ /// Software caused connection abort
495
+ case ECONNABORTED = 103
496
+ /// Connection reset by peer
497
+ case ECONNRESET = 104
498
+ /// No buffer space available
499
+ case ENOBUFS = 105
500
+ /// Transport endpoint is already connected
501
+ case EISCONN = 106
502
+ /// Transport endpoint is not connected
503
+ case ENOTCONN = 107
504
+ /// Cannot send after transport endpoint shutdown
505
+ case ESHUTDOWN = 108
506
+ /// Too many references: cannot splice
507
+ case ETOOMANYREFS = 109
508
+ /// Connection timed out
509
+ case ETIMEDOUT = 110
510
+ /// Connection refused
511
+ case ECONNREFUSED = 111
512
+ /// Host is down
513
+ case EHOSTDOWN = 112
514
+ /// No route to host
515
+ case EHOSTUNREACH = 113
516
+ /// Operation already in progress
517
+ case EALREADY = 114
518
+ /// Operation now in progress
519
+ case EINPROGRESS = 115
520
+ /// Stale NFS file handle
521
+ case ESTALE = 116
522
+ /// Structure needs cleaning
523
+ case EUCLEAN = 117
524
+ /// Not a XENIX named type file
525
+ case ENOTNAM = 118
526
+ /// No XENIX semaphores available
527
+ case ENAVAIL = 119
528
+ /// Is a named type file
529
+ case EISNAM = 120
530
+ /// Remote I/O error
531
+ case EREMOTEIO = 121
532
+ /// Quota exceeded
533
+ case EDQUOT = 122
534
+
535
+ /// No medium found
536
+ case ENOMEDIUM = 123
537
+ /// Wrong medium type
538
+ case EMEDIUMTYPE = 124
539
+ /// Operation Canceled
540
+ case ECANCELED = 125
541
+ /// Required key not available
542
+ case ENOKEY = 126
543
+ /// Key has expired
544
+ case EKEYEXPIRED = 127
545
+ /// Key has been revoked
546
+ case EKEYREVOKED = 128
547
+ /// Key was rejected by service
548
+ case EKEYREJECTED = 129
549
+
550
+ /// Owner died
551
+ case EOWNERDEAD = 130
552
+ /// State not recoverable
553
+ case ENOTRECOVERABLE = 131
475
554
}
476
555
477
556
#endif
0 commit comments