@@ -48,6 +48,10 @@ cfg_if! {
48
48
unsafe fn errno_location( ) -> * mut c_int {
49
49
unsafe { libc:: _Errno( ) }
50
50
}
51
+ } else if #[ cfg( target_os = "nto" ) ] {
52
+ unsafe fn errno_location( ) -> * mut c_int {
53
+ unsafe { libc:: __get_errno_ptr( ) }
54
+ }
51
55
}
52
56
}
53
57
@@ -603,10 +607,10 @@ fn desc(errno: Errno) -> &'static str {
603
607
#[ cfg( freebsdlike) ]
604
608
EDOOFUS => "Programming error" ,
605
609
606
- #[ cfg( any( freebsdlike, target_os = "hurd" , target_os = "redox" ) ) ]
610
+ #[ cfg( any( freebsdlike, target_os = "hurd" , target_os = "redox" , target_os = "nto" , ) ) ]
607
611
EMULTIHOP => "Multihop attempted" ,
608
612
609
- #[ cfg( any( freebsdlike, target_os = "hurd" , target_os = "redox" ) ) ]
613
+ #[ cfg( any( freebsdlike, target_os = "hurd" , target_os = "redox" , target_os = "nto" , ) ) ]
610
614
ENOLINK => "Link has been severed" ,
611
615
612
616
#[ cfg( target_os = "freebsd" ) ]
@@ -615,7 +619,7 @@ fn desc(errno: Errno) -> &'static str {
615
619
#[ cfg( target_os = "freebsd" ) ]
616
620
ECAPMODE => "Not permitted in capability mode" ,
617
621
618
- #[ cfg( any( bsd, target_os = "hurd" ) ) ]
622
+ #[ cfg( all ( not ( target_os = "nto" ) , any( bsd, target_os = "hurd" ) ) ) ]
619
623
ENEEDAUTH => "Need authenticator" ,
620
624
621
625
#[ cfg( any( bsd, target_os = "redox" , solarish) ) ]
@@ -627,17 +631,19 @@ fn desc(errno: Errno) -> &'static str {
627
631
target_os = "netbsd" ,
628
632
target_os = "redox" ,
629
633
target_os = "haiku" ,
634
+ target_os = "nto" ,
630
635
target_os = "hurd"
631
636
) ) ]
632
637
EILSEQ => "Illegal byte sequence" ,
633
638
634
- #[ cfg( any( bsd, target_os = "haiku" ) ) ]
639
+ #[ cfg( all ( not ( target_os = "nto" ) , any( bsd, target_os = "haiku" ) ) ) ]
635
640
ENOATTR => "Attribute not found" ,
636
641
637
642
#[ cfg( any(
638
643
bsd,
639
644
target_os = "redox" ,
640
645
target_os = "haiku" ,
646
+ target_os = "nto" ,
641
647
target_os = "hurd"
642
648
) ) ]
643
649
EBADMSG => "Bad message" ,
@@ -670,7 +676,7 @@ fn desc(errno: Errno) -> &'static str {
670
676
) ) ]
671
677
ENOTSUP => "Operation not supported" ,
672
678
673
- #[ cfg( any( bsd, target_os = "aix" , target_os = "hurd" ) ) ]
679
+ #[ cfg( all ( not ( target_os = "nto" ) , any( bsd, target_os = "aix" , target_os = "hurd" ) ) ) ]
674
680
EPROCLIM => "Too many processes" ,
675
681
676
682
#[ cfg( any(
@@ -718,10 +724,10 @@ fn desc(errno: Errno) -> &'static str {
718
724
#[ cfg( any( bsd, target_os = "hurd" ) ) ]
719
725
EPROCUNAVAIL => "Bad procedure for program" ,
720
726
721
- #[ cfg( any( bsd, target_os = "hurd" ) ) ]
727
+ #[ cfg( all ( not ( target_os = "nto" ) , any( bsd, target_os = "hurd" ) ) ) ]
722
728
EFTYPE => "Inappropriate file type or format" ,
723
729
724
- #[ cfg( any( bsd, target_os = "hurd" ) ) ]
730
+ #[ cfg( all ( not ( target_os = "nto" ) , any( bsd, target_os = "hurd" ) ) ) ]
725
731
EAUTH => "Authentication error" ,
726
732
727
733
#[ cfg( any(
@@ -757,7 +763,8 @@ fn desc(errno: Errno) -> &'static str {
757
763
apple_targets,
758
764
target_os = "aix" ,
759
765
target_os = "netbsd" ,
760
- target_os = "redox"
766
+ target_os = "redox" ,
767
+ target_os = "nto" ,
761
768
) ) ]
762
769
ENODATA => "No message available on STREAM" ,
763
770
@@ -768,23 +775,26 @@ fn desc(errno: Errno) -> &'static str {
768
775
apple_targets,
769
776
target_os = "aix" ,
770
777
target_os = "netbsd" ,
771
- target_os = "redox"
778
+ target_os = "redox" ,
779
+ target_os = "nto" ,
772
780
) ) ]
773
781
ENOSR => "No STREAM resources" ,
774
782
775
783
#[ cfg( any(
776
784
apple_targets,
777
785
target_os = "aix" ,
778
786
target_os = "netbsd" ,
779
- target_os = "redox"
787
+ target_os = "redox" ,
788
+ target_os = "nto" ,
780
789
) ) ]
781
790
ENOSTR => "Not a STREAM" ,
782
791
783
792
#[ cfg( any(
784
793
apple_targets,
785
794
target_os = "aix" ,
786
795
target_os = "netbsd" ,
787
- target_os = "redox"
796
+ target_os = "redox" ,
797
+ target_os = "nto" ,
788
798
) ) ]
789
799
ETIME => "STREAM ioctl timeout" ,
790
800
@@ -797,7 +807,7 @@ fn desc(errno: Errno) -> &'static str {
797
807
#[ cfg( apple_targets) ]
798
808
EQFULL => "Interface output queue is full" ,
799
809
800
- #[ cfg( any( target_os = "openbsd" , target_os = "hurd" ) ) ]
810
+ #[ cfg( any( target_os = "openbsd" , target_os = "hurd" , target_os = "nto" , ) ) ]
801
811
EOPNOTSUPP => "Operation not supported" ,
802
812
803
813
#[ cfg( target_os = "openbsd" ) ]
@@ -3334,3 +3344,212 @@ mod consts {
3334
3344
}
3335
3345
}
3336
3346
}
3347
+
3348
+ #[ cfg( target_os = "nto" ) ]
3349
+ mod consts {
3350
+ #[ derive( Clone , Copy , Debug , Eq , PartialEq ) ]
3351
+ #[ repr( i32 ) ]
3352
+ #[ non_exhaustive]
3353
+ pub enum Errno {
3354
+ UnknownErrno = 0 ,
3355
+ EPERM = libc:: EPERM ,
3356
+ ENOENT = libc:: ENOENT ,
3357
+ ESRCH = libc:: ESRCH ,
3358
+ EINTR = libc:: EINTR ,
3359
+ EIO = libc:: EIO ,
3360
+ ENXIO = libc:: ENXIO ,
3361
+ E2BIG = libc:: E2BIG ,
3362
+ ENOEXEC = libc:: ENOEXEC ,
3363
+ EBADF = libc:: EBADF ,
3364
+ ECHILD = libc:: ECHILD ,
3365
+ EDEADLK = libc:: EDEADLK ,
3366
+ ENOMEM = libc:: ENOMEM ,
3367
+ EACCES = libc:: EACCES ,
3368
+ EFAULT = libc:: EFAULT ,
3369
+ ENOTBLK = libc:: ENOTBLK ,
3370
+ EBUSY = libc:: EBUSY ,
3371
+ EEXIST = libc:: EEXIST ,
3372
+ EXDEV = libc:: EXDEV ,
3373
+ ENODEV = libc:: ENODEV ,
3374
+ ENOTDIR = libc:: ENOTDIR ,
3375
+ EISDIR = libc:: EISDIR ,
3376
+ EINVAL = libc:: EINVAL ,
3377
+ ENFILE = libc:: ENFILE ,
3378
+ EMFILE = libc:: EMFILE ,
3379
+ ENOTTY = libc:: ENOTTY ,
3380
+ ETXTBSY = libc:: ETXTBSY ,
3381
+ EFBIG = libc:: EFBIG ,
3382
+ ENOSPC = libc:: ENOSPC ,
3383
+ ESPIPE = libc:: ESPIPE ,
3384
+ EROFS = libc:: EROFS ,
3385
+ EMLINK = libc:: EMLINK ,
3386
+ EPIPE = libc:: EPIPE ,
3387
+ EDOM = libc:: EDOM ,
3388
+ ERANGE = libc:: ERANGE ,
3389
+ EAGAIN = libc:: EAGAIN ,
3390
+ EINPROGRESS = libc:: EINPROGRESS ,
3391
+ EALREADY = libc:: EALREADY ,
3392
+ ENOTSOCK = libc:: ENOTSOCK ,
3393
+ EDESTADDRREQ = libc:: EDESTADDRREQ ,
3394
+ EMSGSIZE = libc:: EMSGSIZE ,
3395
+ EPROTOTYPE = libc:: EPROTOTYPE ,
3396
+ ENOPROTOOPT = libc:: ENOPROTOOPT ,
3397
+ EPROTONOSUPPORT = libc:: EPROTONOSUPPORT ,
3398
+ ESOCKTNOSUPPORT = libc:: ESOCKTNOSUPPORT ,
3399
+ EOPNOTSUPP = libc:: EOPNOTSUPP ,
3400
+ EPFNOSUPPORT = libc:: EPFNOSUPPORT ,
3401
+ EAFNOSUPPORT = libc:: EAFNOSUPPORT ,
3402
+ EADDRINUSE = libc:: EADDRINUSE ,
3403
+ EADDRNOTAVAIL = libc:: EADDRNOTAVAIL ,
3404
+ ENETDOWN = libc:: ENETDOWN ,
3405
+ ENETUNREACH = libc:: ENETUNREACH ,
3406
+ ENETRESET = libc:: ENETRESET ,
3407
+ ECONNABORTED = libc:: ECONNABORTED ,
3408
+ ECONNRESET = libc:: ECONNRESET ,
3409
+ ENOBUFS = libc:: ENOBUFS ,
3410
+ EISCONN = libc:: EISCONN ,
3411
+ ENOTCONN = libc:: ENOTCONN ,
3412
+ ESHUTDOWN = libc:: ESHUTDOWN ,
3413
+ ETOOMANYREFS = libc:: ETOOMANYREFS ,
3414
+ ETIMEDOUT = libc:: ETIMEDOUT ,
3415
+ ECONNREFUSED = libc:: ECONNREFUSED ,
3416
+ ELOOP = libc:: ELOOP ,
3417
+ ENAMETOOLONG = libc:: ENAMETOOLONG ,
3418
+ EHOSTDOWN = libc:: EHOSTDOWN ,
3419
+ EHOSTUNREACH = libc:: EHOSTUNREACH ,
3420
+ ENOTEMPTY = libc:: ENOTEMPTY ,
3421
+ EUSERS = libc:: EUSERS ,
3422
+ EDQUOT = libc:: EDQUOT ,
3423
+ ESTALE = libc:: ESTALE ,
3424
+ EREMOTE = libc:: EREMOTE ,
3425
+ EBADRPC = libc:: EBADRPC ,
3426
+ ERPCMISMATCH = libc:: ERPCMISMATCH ,
3427
+ EPROGUNAVAIL = libc:: EPROGUNAVAIL ,
3428
+ EPROGMISMATCH = libc:: EPROGMISMATCH ,
3429
+ EPROCUNAVAIL = libc:: EPROCUNAVAIL ,
3430
+ ENOLCK = libc:: ENOLCK ,
3431
+ ENOSYS = libc:: ENOSYS ,
3432
+ EIDRM = libc:: EIDRM ,
3433
+ ENOMSG = libc:: ENOMSG ,
3434
+ EOVERFLOW = libc:: EOVERFLOW ,
3435
+ EILSEQ = libc:: EILSEQ ,
3436
+ ENOTSUP = libc:: ENOTSUP ,
3437
+ ECANCELED = libc:: ECANCELED ,
3438
+ EBADMSG = libc:: EBADMSG ,
3439
+ ENODATA = libc:: ENODATA ,
3440
+ ENOSR = libc:: ENOSR ,
3441
+ ENOSTR = libc:: ENOSTR ,
3442
+ ETIME = libc:: ETIME ,
3443
+ EMULTIHOP = libc:: EMULTIHOP ,
3444
+ ENOLINK = libc:: ENOLINK ,
3445
+ EPROTO = libc:: EPROTO ,
3446
+ }
3447
+
3448
+ impl Errno {
3449
+ pub const ELAST : Errno = Errno :: ENOTSUP ;
3450
+ pub const EWOULDBLOCK : Errno = Errno :: EAGAIN ;
3451
+ }
3452
+
3453
+ #[ deprecated(
3454
+ since = "0.28.0" ,
3455
+ note = "please use `Errno::from_raw()` instead"
3456
+ ) ]
3457
+ pub const fn from_i32 ( e : i32 ) -> Errno {
3458
+ use self :: Errno :: * ;
3459
+
3460
+ match e {
3461
+ libc:: EPERM => EPERM ,
3462
+ libc:: ENOENT => ENOENT ,
3463
+ libc:: ESRCH => ESRCH ,
3464
+ libc:: EINTR => EINTR ,
3465
+ libc:: EIO => EIO ,
3466
+ libc:: ENXIO => ENXIO ,
3467
+ libc:: E2BIG => E2BIG ,
3468
+ libc:: ENOEXEC => ENOEXEC ,
3469
+ libc:: EBADF => EBADF ,
3470
+ libc:: ECHILD => ECHILD ,
3471
+ libc:: EDEADLK => EDEADLK ,
3472
+ libc:: ENOMEM => ENOMEM ,
3473
+ libc:: EACCES => EACCES ,
3474
+ libc:: EFAULT => EFAULT ,
3475
+ libc:: ENOTBLK => ENOTBLK ,
3476
+ libc:: EBUSY => EBUSY ,
3477
+ libc:: EEXIST => EEXIST ,
3478
+ libc:: EXDEV => EXDEV ,
3479
+ libc:: ENODEV => ENODEV ,
3480
+ libc:: ENOTDIR => ENOTDIR ,
3481
+ libc:: EISDIR => EISDIR ,
3482
+ libc:: EINVAL => EINVAL ,
3483
+ libc:: ENFILE => ENFILE ,
3484
+ libc:: EMFILE => EMFILE ,
3485
+ libc:: ENOTTY => ENOTTY ,
3486
+ libc:: ETXTBSY => ETXTBSY ,
3487
+ libc:: EFBIG => EFBIG ,
3488
+ libc:: ENOSPC => ENOSPC ,
3489
+ libc:: ESPIPE => ESPIPE ,
3490
+ libc:: EROFS => EROFS ,
3491
+ libc:: EMLINK => EMLINK ,
3492
+ libc:: EPIPE => EPIPE ,
3493
+ libc:: EDOM => EDOM ,
3494
+ libc:: ERANGE => ERANGE ,
3495
+ libc:: EAGAIN => EAGAIN ,
3496
+ libc:: EINPROGRESS => EINPROGRESS ,
3497
+ libc:: EALREADY => EALREADY ,
3498
+ libc:: ENOTSOCK => ENOTSOCK ,
3499
+ libc:: EDESTADDRREQ => EDESTADDRREQ ,
3500
+ libc:: EMSGSIZE => EMSGSIZE ,
3501
+ libc:: EPROTOTYPE => EPROTOTYPE ,
3502
+ libc:: ENOPROTOOPT => ENOPROTOOPT ,
3503
+ libc:: EPROTONOSUPPORT => EPROTONOSUPPORT ,
3504
+ libc:: ESOCKTNOSUPPORT => ESOCKTNOSUPPORT ,
3505
+ libc:: EOPNOTSUPP => EOPNOTSUPP ,
3506
+ libc:: EPFNOSUPPORT => EPFNOSUPPORT ,
3507
+ libc:: EAFNOSUPPORT => EAFNOSUPPORT ,
3508
+ libc:: EADDRINUSE => EADDRINUSE ,
3509
+ libc:: EADDRNOTAVAIL => EADDRNOTAVAIL ,
3510
+ libc:: ENETDOWN => ENETDOWN ,
3511
+ libc:: ENETUNREACH => ENETUNREACH ,
3512
+ libc:: ENETRESET => ENETRESET ,
3513
+ libc:: ECONNABORTED => ECONNABORTED ,
3514
+ libc:: ECONNRESET => ECONNRESET ,
3515
+ libc:: ENOBUFS => ENOBUFS ,
3516
+ libc:: EISCONN => EISCONN ,
3517
+ libc:: ENOTCONN => ENOTCONN ,
3518
+ libc:: ESHUTDOWN => ESHUTDOWN ,
3519
+ libc:: ETOOMANYREFS => ETOOMANYREFS ,
3520
+ libc:: ETIMEDOUT => ETIMEDOUT ,
3521
+ libc:: ECONNREFUSED => ECONNREFUSED ,
3522
+ libc:: ELOOP => ELOOP ,
3523
+ libc:: ENAMETOOLONG => ENAMETOOLONG ,
3524
+ libc:: EHOSTDOWN => EHOSTDOWN ,
3525
+ libc:: EHOSTUNREACH => EHOSTUNREACH ,
3526
+ libc:: ENOTEMPTY => ENOTEMPTY ,
3527
+ libc:: EUSERS => EUSERS ,
3528
+ libc:: EDQUOT => EDQUOT ,
3529
+ libc:: ESTALE => ESTALE ,
3530
+ libc:: EREMOTE => EREMOTE ,
3531
+ libc:: EBADRPC => EBADRPC ,
3532
+ libc:: ERPCMISMATCH => ERPCMISMATCH ,
3533
+ libc:: EPROGUNAVAIL => EPROGUNAVAIL ,
3534
+ libc:: EPROGMISMATCH => EPROGMISMATCH ,
3535
+ libc:: EPROCUNAVAIL => EPROCUNAVAIL ,
3536
+ libc:: ENOLCK => ENOLCK ,
3537
+ libc:: ENOSYS => ENOSYS ,
3538
+ libc:: EIDRM => EIDRM ,
3539
+ libc:: ENOMSG => ENOMSG ,
3540
+ libc:: EOVERFLOW => EOVERFLOW ,
3541
+ libc:: EILSEQ => EILSEQ ,
3542
+ libc:: ENOTSUP => ENOTSUP ,
3543
+ libc:: ECANCELED => ECANCELED ,
3544
+ libc:: EBADMSG => EBADMSG ,
3545
+ libc:: ENODATA => ENODATA ,
3546
+ libc:: ENOSR => ENOSR ,
3547
+ libc:: ENOSTR => ENOSTR ,
3548
+ libc:: ETIME => ETIME ,
3549
+ libc:: EMULTIHOP => EMULTIHOP ,
3550
+ libc:: ENOLINK => ENOLINK ,
3551
+ libc:: EPROTO => EPROTO ,
3552
+ _ => UnknownErrno ,
3553
+ }
3554
+ }
3555
+ }
0 commit comments