|
12 | 12 |
|
13 | 13 | #![stable(feature = "raw_ext", since = "1.1.0")] |
14 | 14 |
|
15 | | -use os::raw::c_long; |
16 | | -use os::unix::raw::{uid_t, gid_t}; |
| 15 | +#[stable(feature = "raw_ext", since = "1.1.0")] pub type off_t = i64; |
| 16 | +#[stable(feature = "raw_ext", since = "1.1.0")] pub type dev_t = u32; |
| 17 | +#[stable(feature = "raw_ext", since = "1.1.0")] pub type ino_t = u32; |
| 18 | +#[stable(feature = "raw_ext", since = "1.1.0")] pub type mode_t = u16; |
| 19 | +#[stable(feature = "raw_ext", since = "1.1.0")] pub type nlink_t = u16; |
| 20 | +#[stable(feature = "raw_ext", since = "1.1.0")] pub type blksize_t = u32; |
| 21 | +#[stable(feature = "raw_ext", since = "1.1.0")] pub type blkcnt_t = i64; |
| 22 | +#[stable(feature = "raw_ext", since = "1.1.0")] pub type fflags_t = u32; |
17 | 23 |
|
18 | | -#[stable(feature = "raw_ext", since = "1.1.0")] |
19 | | -pub type blkcnt_t = i64; |
20 | | -#[stable(feature = "raw_ext", since = "1.1.0")] |
21 | | -pub type blksize_t = i64; |
22 | | -#[stable(feature = "raw_ext", since = "1.1.0")] |
23 | | -pub type dev_t = u32; |
24 | | -#[stable(feature = "raw_ext", since = "1.1.0")] |
25 | | -pub type fflags_t = u32; |
26 | | -#[stable(feature = "raw_ext", since = "1.1.0")] |
27 | | -pub type ino_t = u32; |
28 | | -#[stable(feature = "raw_ext", since = "1.1.0")] |
29 | | -pub type mode_t = u16; |
30 | | -#[stable(feature = "raw_ext", since = "1.1.0")] |
31 | | -pub type nlink_t = u16; |
32 | | -#[stable(feature = "raw_ext", since = "1.1.0")] |
33 | | -pub type off_t = i64; |
34 | | -#[stable(feature = "raw_ext", since = "1.1.0")] |
35 | | -pub type time_t = i64; |
| 24 | +#[doc(inline)] |
| 25 | +pub use self::arch::{stat, time_t}; |
36 | 26 |
|
37 | | -#[repr(C)] |
38 | | -#[stable(feature = "raw_ext", since = "1.1.0")] |
39 | | -pub struct stat { |
40 | | - #[stable(feature = "raw_ext", since = "1.1.0")] |
41 | | - pub st_dev: dev_t, |
42 | | - #[stable(feature = "raw_ext", since = "1.1.0")] |
43 | | - pub st_ino: ino_t, |
44 | | - #[stable(feature = "raw_ext", since = "1.1.0")] |
45 | | - pub st_mode: mode_t, |
46 | | - #[stable(feature = "raw_ext", since = "1.1.0")] |
47 | | - pub st_nlink: nlink_t, |
48 | | - #[stable(feature = "raw_ext", since = "1.1.0")] |
49 | | - pub st_uid: uid_t, |
50 | | - #[stable(feature = "raw_ext", since = "1.1.0")] |
51 | | - pub st_gid: gid_t, |
52 | | - #[stable(feature = "raw_ext", since = "1.1.0")] |
53 | | - pub st_rdev: dev_t, |
54 | | - #[stable(feature = "raw_ext", since = "1.1.0")] |
55 | | - pub st_atime: time_t, |
56 | | - #[stable(feature = "raw_ext", since = "1.1.0")] |
57 | | - pub st_atime_nsec: c_long, |
58 | | - #[stable(feature = "raw_ext", since = "1.1.0")] |
59 | | - pub st_mtime: time_t, |
60 | | - #[stable(feature = "raw_ext", since = "1.1.0")] |
61 | | - pub st_mtime_nsec: c_long, |
62 | | - #[stable(feature = "raw_ext", since = "1.1.0")] |
63 | | - pub st_ctime: time_t, |
64 | | - #[stable(feature = "raw_ext", since = "1.1.0")] |
65 | | - pub st_ctime_nsec: c_long, |
66 | | - #[stable(feature = "raw_ext", since = "1.1.0")] |
67 | | - pub st_size: off_t, |
68 | | - #[stable(feature = "raw_ext", since = "1.1.0")] |
69 | | - pub st_blocks: blkcnt_t, |
70 | | - #[stable(feature = "raw_ext", since = "1.1.0")] |
71 | | - pub st_blksize: blksize_t, |
72 | | - #[stable(feature = "raw_ext", since = "1.1.0")] |
73 | | - pub st_flags: fflags_t, |
74 | | - #[stable(feature = "raw_ext", since = "1.1.0")] |
75 | | - pub st_gen: u32, |
76 | | - #[stable(feature = "raw_ext", since = "1.1.0")] |
77 | | - pub st_lspare: i32, |
78 | | - #[stable(feature = "raw_ext", since = "1.1.0")] |
79 | | - pub st_birthtime: time_t, |
80 | | - #[stable(feature = "raw_ext", since = "1.1.0")] |
81 | | - pub st_birthtime_nsec: c_long, |
82 | | - #[stable(feature = "raw_ext", since = "1.1.0")] |
83 | | - pub __unused: [u8; 2], |
| 27 | +#[cfg(target_arch = "x86")] |
| 28 | +mod arch { |
| 29 | + use super::{off_t, dev_t, ino_t, mode_t, nlink_t, blksize_t, blkcnt_t, fflags_t}; |
| 30 | + use os::raw::c_long; |
| 31 | + use os::unix::raw::{uid_t, gid_t}; |
| 32 | + |
| 33 | + #[stable(feature = "raw_ext", since = "1.1.0")] pub type time_t = i32; |
| 34 | + |
| 35 | + #[repr(C)] |
| 36 | + #[stable(feature = "raw_ext", since = "1.1.0")] |
| 37 | + pub struct stat { |
| 38 | + #[stable(feature = "raw_ext", since = "1.1.0")] |
| 39 | + pub st_dev: dev_t, |
| 40 | + #[stable(feature = "raw_ext", since = "1.1.0")] |
| 41 | + pub st_ino: ino_t, |
| 42 | + #[stable(feature = "raw_ext", since = "1.1.0")] |
| 43 | + pub st_mode: mode_t, |
| 44 | + #[stable(feature = "raw_ext", since = "1.1.0")] |
| 45 | + pub st_nlink: nlink_t, |
| 46 | + #[stable(feature = "raw_ext", since = "1.1.0")] |
| 47 | + pub st_uid: uid_t, |
| 48 | + #[stable(feature = "raw_ext", since = "1.1.0")] |
| 49 | + pub st_gid: gid_t, |
| 50 | + #[stable(feature = "raw_ext", since = "1.1.0")] |
| 51 | + pub st_rdev: dev_t, |
| 52 | + #[stable(feature = "raw_ext", since = "1.1.0")] |
| 53 | + pub st_atime: time_t, |
| 54 | + #[stable(feature = "raw_ext", since = "1.1.0")] |
| 55 | + pub st_atime_nsec: c_long, |
| 56 | + #[stable(feature = "raw_ext", since = "1.1.0")] |
| 57 | + pub st_mtime: time_t, |
| 58 | + #[stable(feature = "raw_ext", since = "1.1.0")] |
| 59 | + pub st_mtime_nsec: c_long, |
| 60 | + #[stable(feature = "raw_ext", since = "1.1.0")] |
| 61 | + pub st_ctime: time_t, |
| 62 | + #[stable(feature = "raw_ext", since = "1.1.0")] |
| 63 | + pub st_ctime_nsec: c_long, |
| 64 | + #[stable(feature = "raw_ext", since = "1.1.0")] |
| 65 | + pub st_size: off_t, |
| 66 | + #[stable(feature = "raw_ext", since = "1.1.0")] |
| 67 | + pub st_blocks: blkcnt_t, |
| 68 | + #[stable(feature = "raw_ext", since = "1.1.0")] |
| 69 | + pub st_blksize: blksize_t, |
| 70 | + #[stable(feature = "raw_ext", since = "1.1.0")] |
| 71 | + pub st_flags: fflags_t, |
| 72 | + #[stable(feature = "raw_ext", since = "1.1.0")] |
| 73 | + pub st_gen: u32, |
| 74 | + #[stable(feature = "raw_ext", since = "1.1.0")] |
| 75 | + pub st_lspare: i32, |
| 76 | + #[stable(feature = "raw_ext", since = "1.1.0")] |
| 77 | + pub st_birthtime: time_t, |
| 78 | + #[stable(feature = "raw_ext", since = "1.1.0")] |
| 79 | + pub st_birthtime_nsec: c_long, |
| 80 | + #[stable(feature = "raw_ext", since = "1.1.0")] |
| 81 | + pub __unused: [u8; 8], |
| 82 | + } |
84 | 83 | } |
| 84 | + |
| 85 | +#[cfg(target_arch = "x86_64")] |
| 86 | +mod arch { |
| 87 | + use super::{off_t, dev_t, ino_t, mode_t, nlink_t, blksize_t, blkcnt_t, fflags_t}; |
| 88 | + use os::raw::c_long; |
| 89 | + use os::unix::raw::{uid_t, gid_t}; |
| 90 | + |
| 91 | + #[stable(feature = "raw_ext", since = "1.1.0")] pub type time_t = i64; |
| 92 | + |
| 93 | + #[repr(C)] |
| 94 | + #[stable(feature = "raw_ext", since = "1.1.0")] |
| 95 | + pub struct stat { |
| 96 | + #[stable(feature = "raw_ext", since = "1.1.0")] |
| 97 | + pub st_dev: dev_t, |
| 98 | + #[stable(feature = "raw_ext", since = "1.1.0")] |
| 99 | + pub st_ino: ino_t, |
| 100 | + #[stable(feature = "raw_ext", since = "1.1.0")] |
| 101 | + pub st_mode: mode_t, |
| 102 | + #[stable(feature = "raw_ext", since = "1.1.0")] |
| 103 | + pub st_nlink: nlink_t, |
| 104 | + #[stable(feature = "raw_ext", since = "1.1.0")] |
| 105 | + pub st_uid: uid_t, |
| 106 | + #[stable(feature = "raw_ext", since = "1.1.0")] |
| 107 | + pub st_gid: gid_t, |
| 108 | + #[stable(feature = "raw_ext", since = "1.1.0")] |
| 109 | + pub st_rdev: dev_t, |
| 110 | + #[stable(feature = "raw_ext", since = "1.1.0")] |
| 111 | + pub st_atime: time_t, |
| 112 | + #[stable(feature = "raw_ext", since = "1.1.0")] |
| 113 | + pub st_atime_nsec: c_long, |
| 114 | + #[stable(feature = "raw_ext", since = "1.1.0")] |
| 115 | + pub st_mtime: time_t, |
| 116 | + #[stable(feature = "raw_ext", since = "1.1.0")] |
| 117 | + pub st_mtime_nsec: c_long, |
| 118 | + #[stable(feature = "raw_ext", since = "1.1.0")] |
| 119 | + pub st_ctime: time_t, |
| 120 | + #[stable(feature = "raw_ext", since = "1.1.0")] |
| 121 | + pub st_ctime_nsec: c_long, |
| 122 | + #[stable(feature = "raw_ext", since = "1.1.0")] |
| 123 | + pub st_size: off_t, |
| 124 | + #[stable(feature = "raw_ext", since = "1.1.0")] |
| 125 | + pub st_blocks: blkcnt_t, |
| 126 | + #[stable(feature = "raw_ext", since = "1.1.0")] |
| 127 | + pub st_blksize: blksize_t, |
| 128 | + #[stable(feature = "raw_ext", since = "1.1.0")] |
| 129 | + pub st_flags: fflags_t, |
| 130 | + #[stable(feature = "raw_ext", since = "1.1.0")] |
| 131 | + pub st_gen: u32, |
| 132 | + #[stable(feature = "raw_ext", since = "1.1.0")] |
| 133 | + pub st_lspare: i32, |
| 134 | + #[stable(feature = "raw_ext", since = "1.1.0")] |
| 135 | + pub st_birthtime: time_t, |
| 136 | + #[stable(feature = "raw_ext", since = "1.1.0")] |
| 137 | + pub st_birthtime_nsec: c_long, |
| 138 | + } |
| 139 | +} |
| 140 | + |
| 141 | + |
0 commit comments