@@ -268,14 +268,17 @@ pub mod types {
268268 pub type ssize_t = i32 ;
269269 }
270270 pub mod posix01 {
271- use libc:: types:: os:: arch:: c95:: { c_short, c_long, time_t} ;
271+ use libc:: types:: os:: arch:: c95:: { c_short, c_long, c_ulong , time_t} ;
272272 use libc:: types:: os:: arch:: posix88:: { dev_t, gid_t, ino_t} ;
273273 use libc:: types:: os:: arch:: posix88:: { mode_t, off_t} ;
274274 use libc:: types:: os:: arch:: posix88:: { uid_t} ;
275275
276276 pub type nlink_t = u32 ;
277277 pub type blksize_t = i32 ;
278278 pub type blkcnt_t = i32 ;
279+
280+ #[ cfg( target_arch = "x86" ) ]
281+ #[ cfg( target_arch = "arm" ) ]
279282 pub struct stat {
280283 st_dev : dev_t ,
281284 __pad1 : c_short ,
@@ -298,6 +301,30 @@ pub mod types {
298301 __unused4 : c_long ,
299302 __unused5 : c_long ,
300303 }
304+
305+ #[ cfg( target_arch = "mips" ) ]
306+ pub struct stat {
307+ st_dev : c_ulong ,
308+ st_pad1 : [ c_long , ..3 ] ,
309+ st_ino : ino_t ,
310+ st_mode : mode_t ,
311+ st_nlink : nlink_t ,
312+ st_uid : uid_t ,
313+ st_gid : gid_t ,
314+ st_rdev : c_ulong ,
315+ st_pad2 : [ c_long , ..2 ] ,
316+ st_size : off_t ,
317+ st_pad3 : c_long ,
318+ st_atime : time_t ,
319+ st_atime_nsec : c_long ,
320+ st_mtime : time_t ,
321+ st_mtime_nsec : c_long ,
322+ st_ctime : time_t ,
323+ st_ctime_nsec : c_long ,
324+ st_blksize : blksize_t ,
325+ st_blocks : blkcnt_t ,
326+ st_pad5 : [ c_long , ..14 ] ,
327+ }
301328 }
302329 pub mod posix08 { }
303330 pub mod bsd44 { }
@@ -963,6 +990,9 @@ pub mod consts {
963990 }
964991 pub mod c99 {
965992 }
993+ #[ cfg( target_arch = "x86" ) ]
994+ #[ cfg( target_arch = "x86_64" ) ]
995+ #[ cfg( target_arch = "arm" ) ]
966996 pub mod posix88 {
967997 pub static O_RDONLY : int = 0 ;
968998 pub static O_WRONLY : int = 1 ;
@@ -1007,6 +1037,51 @@ pub mod consts {
10071037 pub static SIGALRM : int = 14 ;
10081038 pub static SIGTERM : int = 15 ;
10091039 }
1040+ #[ cfg( target_arch = "mips" ) ]
1041+ pub mod posix88 {
1042+ pub static O_RDONLY : int = 0 ;
1043+ pub static O_WRONLY : int = 1 ;
1044+ pub static O_RDWR : int = 2 ;
1045+ pub static O_APPEND : int = 8 ;
1046+ pub static O_CREAT : int = 256 ;
1047+ pub static O_EXCL : int = 1024 ;
1048+ pub static O_TRUNC : int = 512 ;
1049+ pub static S_IFIFO : int = 4096 ;
1050+ pub static S_IFCHR : int = 8192 ;
1051+ pub static S_IFBLK : int = 24576 ;
1052+ pub static S_IFDIR : int = 16384 ;
1053+ pub static S_IFREG : int = 32768 ;
1054+ pub static S_IFMT : int = 61440 ;
1055+ pub static S_IEXEC : int = 64 ;
1056+ pub static S_IWRITE : int = 128 ;
1057+ pub static S_IREAD : int = 256 ;
1058+ pub static S_IRWXU : int = 448 ;
1059+ pub static S_IXUSR : int = 64 ;
1060+ pub static S_IWUSR : int = 128 ;
1061+ pub static S_IRUSR : int = 256 ;
1062+ pub static F_OK : int = 0 ;
1063+ pub static R_OK : int = 4 ;
1064+ pub static W_OK : int = 2 ;
1065+ pub static X_OK : int = 1 ;
1066+ pub static STDIN_FILENO : int = 0 ;
1067+ pub static STDOUT_FILENO : int = 1 ;
1068+ pub static STDERR_FILENO : int = 2 ;
1069+ pub static F_LOCK : int = 1 ;
1070+ pub static F_TEST : int = 3 ;
1071+ pub static F_TLOCK : int = 2 ;
1072+ pub static F_ULOCK : int = 0 ;
1073+ pub static SIGHUP : int = 1 ;
1074+ pub static SIGINT : int = 2 ;
1075+ pub static SIGQUIT : int = 3 ;
1076+ pub static SIGILL : int = 4 ;
1077+ pub static SIGABRT : int = 6 ;
1078+ pub static SIGFPE : int = 8 ;
1079+ pub static SIGKILL : int = 9 ;
1080+ pub static SIGSEGV : int = 11 ;
1081+ pub static SIGPIPE : int = 13 ;
1082+ pub static SIGALRM : int = 14 ;
1083+ pub static SIGTERM : int = 15 ;
1084+ }
10101085 pub mod posix01 {
10111086 pub static SIGTRAP : int = 5 ;
10121087
@@ -1026,11 +1101,20 @@ pub mod consts {
10261101 }
10271102 pub mod bsd44 {
10281103 }
1104+ #[ cfg( target_arch = "x86" ) ]
1105+ #[ cfg( target_arch = "x86_64" ) ]
1106+ #[ cfg( target_arch = "arm" ) ]
10291107 pub mod extra {
10301108 pub static O_RSYNC : int = 1052672 ;
10311109 pub static O_DSYNC : int = 4096 ;
10321110 pub static O_SYNC : int = 1052672 ;
10331111 }
1112+ #[ cfg( target_arch = "mips" ) ]
1113+ pub mod extra {
1114+ pub static O_RSYNC : int = 16400 ;
1115+ pub static O_DSYNC : int = 16 ;
1116+ pub static O_SYNC : int = 16400 ;
1117+ }
10341118 }
10351119
10361120 #[ cfg( target_os = "freebsd" ) ]
0 commit comments