@@ -720,10 +720,14 @@ pub mod types {
720
720
721
721
}
722
722
723
- #[ cfg( target_arch = "x86_64" ) ]
723
+ #[ cfg( any( target_arch = "x86_64" ,
724
+ target_arch = "aarch64" ) ) ]
724
725
pub mod arch {
725
726
pub mod c95 {
727
+ #[ cfg( not( target_arch = "aarch64" ) ) ]
726
728
pub type c_char = i8 ;
729
+ #[ cfg( target_arch = "aarch64" ) ]
730
+ pub type c_char = u8 ;
727
731
pub type c_schar = i8 ;
728
732
pub type c_uchar = u8 ;
729
733
pub type c_short = i16 ;
@@ -739,7 +743,10 @@ pub mod types {
739
743
pub type clock_t = i64 ;
740
744
pub type time_t = i64 ;
741
745
pub type suseconds_t = i64 ;
746
+ #[ cfg( not( target_arch = "aarch64" ) ) ]
742
747
pub type wchar_t = i32 ;
748
+ #[ cfg( target_arch = "aarch64" ) ]
749
+ pub type wchar_t = u32 ;
743
750
}
744
751
pub mod c99 {
745
752
pub type c_longlong = i64 ;
@@ -760,6 +767,7 @@ pub mod types {
760
767
pub type mode_t = u32 ;
761
768
pub type ssize_t = i64 ;
762
769
}
770
+ #[ cfg( not( target_arch = "aarch64" ) ) ]
763
771
pub mod posix01 {
764
772
use types:: os:: arch:: c95:: { c_int, c_long, time_t} ;
765
773
use types:: os:: arch:: posix88:: { dev_t, gid_t, ino_t} ;
@@ -769,6 +777,7 @@ pub mod types {
769
777
pub type nlink_t = u64 ;
770
778
pub type blksize_t = i64 ;
771
779
pub type blkcnt_t = i64 ;
780
+
772
781
#[ repr( C ) ]
773
782
#[ deriving( Copy ) ] pub struct stat {
774
783
pub st_dev : dev_t ,
@@ -802,6 +811,51 @@ pub mod types {
802
811
pub __size : [ u64 , ..7 ]
803
812
}
804
813
}
814
+ #[ cfg( target_arch = "aarch64" ) ]
815
+ pub mod posix01 {
816
+ use types:: os:: arch:: c95:: { c_int, c_long, time_t} ;
817
+ use types:: os:: arch:: posix88:: { dev_t, gid_t, ino_t} ;
818
+ use types:: os:: arch:: posix88:: { mode_t, off_t} ;
819
+ use types:: os:: arch:: posix88:: { uid_t} ;
820
+
821
+ pub type nlink_t = u32 ;
822
+ pub type blksize_t = i32 ;
823
+ pub type blkcnt_t = i64 ;
824
+
825
+ #[ repr( C ) ]
826
+ #[ deriving( Copy ) ] pub struct stat {
827
+ pub st_dev : dev_t ,
828
+ pub st_ino : ino_t ,
829
+ pub st_mode : mode_t ,
830
+ pub st_nlink : nlink_t ,
831
+ pub st_uid : uid_t ,
832
+ pub st_gid : gid_t ,
833
+ pub st_rdev : dev_t ,
834
+ pub __pad1 : dev_t ,
835
+ pub st_size : off_t ,
836
+ pub st_blksize : blksize_t ,
837
+ pub __pad2 : c_int ,
838
+ pub st_blocks : blkcnt_t ,
839
+ pub st_atime : time_t ,
840
+ pub st_atime_nsec : c_long ,
841
+ pub st_mtime : time_t ,
842
+ pub st_mtime_nsec : c_long ,
843
+ pub st_ctime : time_t ,
844
+ pub st_ctime_nsec : c_long ,
845
+ pub __unused : [ c_int , ..2 ] ,
846
+ }
847
+
848
+ #[ repr( C ) ]
849
+ #[ deriving( Copy ) ] pub struct utimbuf {
850
+ pub actime : time_t ,
851
+ pub modtime : time_t ,
852
+ }
853
+
854
+ #[ repr( C ) ]
855
+ #[ deriving( Copy ) ] pub struct pthread_attr_t {
856
+ pub __size : [ u64 , ..8 ]
857
+ }
858
+ }
805
859
pub mod posix08 {
806
860
}
807
861
pub mod bsd44 {
@@ -2432,7 +2486,8 @@ pub mod consts {
2432
2486
}
2433
2487
#[ cfg( any( target_arch = "x86" ,
2434
2488
target_arch = "x86_64" ,
2435
- target_arch = "arm" ) ) ]
2489
+ target_arch = "arm" ,
2490
+ target_arch = "aarch64" ) ) ]
2436
2491
pub mod posix88 {
2437
2492
use types:: os:: arch:: c95:: c_int;
2438
2493
use types:: common:: c95:: c_void;
@@ -2927,7 +2982,9 @@ pub mod consts {
2927
2982
pub const PTHREAD_STACK_MIN : size_t = 16384 ;
2928
2983
2929
2984
#[ cfg( all( target_os = "linux" ,
2930
- any( target_arch = "mips" , target_arch = "mipsel" ) ) ) ]
2985
+ any( target_arch = "mips" ,
2986
+ target_arch = "mipsel" ,
2987
+ target_arch = "aarch64" ) ) ) ]
2931
2988
pub const PTHREAD_STACK_MIN : size_t = 131072 ;
2932
2989
2933
2990
pub const CLOCK_REALTIME : c_int = 0 ;
@@ -2936,6 +2993,7 @@ pub mod consts {
2936
2993
pub mod posix08 {
2937
2994
}
2938
2995
#[ cfg( any( target_arch = "arm" ,
2996
+ target_arch = "aarch64" ,
2939
2997
target_arch = "x86" ,
2940
2998
target_arch = "x86_64" ) ) ]
2941
2999
pub mod bsd44 {
@@ -3031,7 +3089,8 @@ pub mod consts {
3031
3089
}
3032
3090
#[ cfg( any( target_arch = "x86" ,
3033
3091
target_arch = "x86_64" ,
3034
- target_arch = "arm" ) ) ]
3092
+ target_arch = "arm" ,
3093
+ target_arch = "aarch64" ) ) ]
3035
3094
pub mod extra {
3036
3095
use types:: os:: arch:: c95:: c_int;
3037
3096
0 commit comments