1- // Copyright 2012-2014 The Rust Project Developers. See the COPYRIGHT
1+ // Copyright 2012-2015 The Rust Project Developers. See the COPYRIGHT
22// file at the top-level directory of this distribution and at
33// http://rust-lang.org/COPYRIGHT.
44//
@@ -720,10 +720,14 @@ pub mod types {
720720
721721 }
722722
723- #[ cfg( target_arch = "x86_64" ) ]
723+ #[ cfg( any( target_arch = "x86_64" ,
724+ target_arch = "aarch64" ) ) ]
724725 pub mod arch {
725726 pub mod c95 {
727+ #[ cfg( not( target_arch = "aarch64" ) ) ]
726728 pub type c_char = i8 ;
729+ #[ cfg( target_arch = "aarch64" ) ]
730+ pub type c_char = u8 ;
727731 pub type c_schar = i8 ;
728732 pub type c_uchar = u8 ;
729733 pub type c_short = i16 ;
@@ -739,7 +743,10 @@ pub mod types {
739743 pub type clock_t = i64 ;
740744 pub type time_t = i64 ;
741745 pub type suseconds_t = i64 ;
746+ #[ cfg( not( target_arch = "aarch64" ) ) ]
742747 pub type wchar_t = i32 ;
748+ #[ cfg( target_arch = "aarch64" ) ]
749+ pub type wchar_t = u32 ;
743750 }
744751 pub mod c99 {
745752 pub type c_longlong = i64 ;
@@ -760,6 +767,7 @@ pub mod types {
760767 pub type mode_t = u32 ;
761768 pub type ssize_t = i64 ;
762769 }
770+ #[ cfg( not( target_arch = "aarch64" ) ) ]
763771 pub mod posix01 {
764772 use types:: os:: arch:: c95:: { c_int, c_long, time_t} ;
765773 use types:: os:: arch:: posix88:: { dev_t, gid_t, ino_t} ;
@@ -769,6 +777,7 @@ pub mod types {
769777 pub type nlink_t = u64 ;
770778 pub type blksize_t = i64 ;
771779 pub type blkcnt_t = i64 ;
780+
772781 #[ repr( C ) ]
773782 #[ deriving( Copy ) ] pub struct stat {
774783 pub st_dev : dev_t ,
@@ -802,6 +811,51 @@ pub mod types {
802811 pub __size : [ u64 ; 7 ]
803812 }
804813 }
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+ }
805859 pub mod posix08 {
806860 }
807861 pub mod bsd44 {
@@ -2444,7 +2498,8 @@ pub mod consts {
24442498 }
24452499 #[ cfg( any( target_arch = "x86" ,
24462500 target_arch = "x86_64" ,
2447- target_arch = "arm" ) ) ]
2501+ target_arch = "arm" ,
2502+ target_arch = "aarch64" ) ) ]
24482503 pub mod posix88 {
24492504 use types:: os:: arch:: c95:: c_int;
24502505 use types:: common:: c95:: c_void;
@@ -2939,7 +2994,9 @@ pub mod consts {
29392994 pub const PTHREAD_STACK_MIN : size_t = 16384 ;
29402995
29412996 #[ cfg( all( target_os = "linux" ,
2942- any( target_arch = "mips" , target_arch = "mipsel" ) ) ) ]
2997+ any( target_arch = "mips" ,
2998+ target_arch = "mipsel" ,
2999+ target_arch = "aarch64" ) ) ) ]
29433000 pub const PTHREAD_STACK_MIN : size_t = 131072 ;
29443001
29453002 pub const CLOCK_REALTIME : c_int = 0 ;
@@ -2948,6 +3005,7 @@ pub mod consts {
29483005 pub mod posix08 {
29493006 }
29503007 #[ cfg( any( target_arch = "arm" ,
3008+ target_arch = "aarch64" ,
29513009 target_arch = "x86" ,
29523010 target_arch = "x86_64" ) ) ]
29533011 pub mod bsd44 {
@@ -3043,7 +3101,8 @@ pub mod consts {
30433101 }
30443102 #[ cfg( any( target_arch = "x86" ,
30453103 target_arch = "x86_64" ,
3046- target_arch = "arm" ) ) ]
3104+ target_arch = "arm" ,
3105+ target_arch = "aarch64" ) ) ]
30473106 pub mod extra {
30483107 use types:: os:: arch:: c95:: c_int;
30493108
0 commit comments