]>
Commit | Line | Data |
---|---|---|
d9579d0f AL |
1 | //! Android-specific raw type definitions |
2 | ||
3 | #![stable(feature = "raw_ext", since = "1.1.0")] | |
04454e1e | 4 | #![deprecated( |
60c5eb7d | 5 | since = "1.8.0", |
04454e1e FG |
6 | note = "these type aliases are no longer supported by \ |
7 | the standard library, the `libc` crate on \ | |
8 | crates.io should be used instead for the correct \ | |
9 | definitions" | |
60c5eb7d | 10 | )] |
7453a54e | 11 | #![allow(deprecated)] |
d9579d0f | 12 | |
532ac7d7 | 13 | use crate::os::raw::c_long; |
92a42be0 | 14 | |
3157f602 XL |
15 | #[stable(feature = "pthread_t", since = "1.8.0")] |
16 | pub type pthread_t = c_long; | |
92a42be0 | 17 | |
62682a34 | 18 | #[doc(inline)] |
92a42be0 | 19 | #[stable(feature = "raw_ext", since = "1.1.0")] |
60c5eb7d | 20 | pub use self::arch::{blkcnt_t, blksize_t, dev_t, ino_t, mode_t, nlink_t, off_t, stat, time_t}; |
d9579d0f | 21 | |
e9174d1e | 22 | #[cfg(any(target_arch = "arm", target_arch = "x86"))] |
62682a34 | 23 | mod arch { |
60c5eb7d XL |
24 | use crate::os::raw::{c_longlong, c_uchar, c_uint, c_ulong, c_ulonglong}; |
25 | use crate::os::unix::raw::{gid_t, uid_t}; | |
d9579d0f | 26 | |
d9579d0f | 27 | #[stable(feature = "raw_ext", since = "1.1.0")] |
7453a54e | 28 | pub type dev_t = u64; |
d9579d0f | 29 | #[stable(feature = "raw_ext", since = "1.1.0")] |
7453a54e | 30 | pub type mode_t = u32; |
62682a34 | 31 | |
d9579d0f | 32 | #[stable(feature = "raw_ext", since = "1.1.0")] |
7453a54e | 33 | pub type blkcnt_t = u64; |
d9579d0f | 34 | #[stable(feature = "raw_ext", since = "1.1.0")] |
7453a54e | 35 | pub type blksize_t = u64; |
d9579d0f | 36 | #[stable(feature = "raw_ext", since = "1.1.0")] |
7453a54e | 37 | pub type ino_t = u64; |
d9579d0f | 38 | #[stable(feature = "raw_ext", since = "1.1.0")] |
7453a54e | 39 | pub type nlink_t = u64; |
d9579d0f | 40 | #[stable(feature = "raw_ext", since = "1.1.0")] |
7453a54e | 41 | pub type off_t = u64; |
d9579d0f | 42 | #[stable(feature = "raw_ext", since = "1.1.0")] |
7453a54e | 43 | pub type time_t = i64; |
62682a34 SL |
44 | |
45 | #[repr(C)] | |
b039eaaf | 46 | #[derive(Clone)] |
62682a34 SL |
47 | #[stable(feature = "raw_ext", since = "1.1.0")] |
48 | pub struct stat { | |
49 | #[stable(feature = "raw_ext", since = "1.1.0")] | |
50 | pub st_dev: c_ulonglong, | |
51 | #[stable(feature = "raw_ext", since = "1.1.0")] | |
52 | pub __pad0: [c_uchar; 4], | |
53 | #[stable(feature = "raw_ext", since = "1.1.0")] | |
7453a54e | 54 | pub __st_ino: u32, |
62682a34 SL |
55 | #[stable(feature = "raw_ext", since = "1.1.0")] |
56 | pub st_mode: c_uint, | |
57 | #[stable(feature = "raw_ext", since = "1.1.0")] | |
58 | pub st_nlink: c_uint, | |
59 | #[stable(feature = "raw_ext", since = "1.1.0")] | |
60 | pub st_uid: uid_t, | |
61 | #[stable(feature = "raw_ext", since = "1.1.0")] | |
62 | pub st_gid: gid_t, | |
63 | #[stable(feature = "raw_ext", since = "1.1.0")] | |
64 | pub st_rdev: c_ulonglong, | |
65 | #[stable(feature = "raw_ext", since = "1.1.0")] | |
66 | pub __pad3: [c_uchar; 4], | |
67 | #[stable(feature = "raw_ext", since = "1.1.0")] | |
68 | pub st_size: c_longlong, | |
69 | #[stable(feature = "raw_ext", since = "1.1.0")] | |
7453a54e | 70 | pub st_blksize: u32, |
62682a34 SL |
71 | #[stable(feature = "raw_ext", since = "1.1.0")] |
72 | pub st_blocks: c_ulonglong, | |
73 | #[stable(feature = "raw_ext", since = "1.1.0")] | |
7453a54e | 74 | pub st_atime: c_ulong, |
62682a34 SL |
75 | #[stable(feature = "raw_ext", since = "1.1.0")] |
76 | pub st_atime_nsec: c_ulong, | |
77 | #[stable(feature = "raw_ext", since = "1.1.0")] | |
7453a54e | 78 | pub st_mtime: c_ulong, |
62682a34 SL |
79 | #[stable(feature = "raw_ext", since = "1.1.0")] |
80 | pub st_mtime_nsec: c_ulong, | |
81 | #[stable(feature = "raw_ext", since = "1.1.0")] | |
7453a54e | 82 | pub st_ctime: c_ulong, |
62682a34 SL |
83 | #[stable(feature = "raw_ext", since = "1.1.0")] |
84 | pub st_ctime_nsec: c_ulong, | |
85 | #[stable(feature = "raw_ext", since = "1.1.0")] | |
86 | pub st_ino: c_ulonglong, | |
87 | } | |
62682a34 SL |
88 | } |
89 | ||
62682a34 SL |
90 | #[cfg(target_arch = "aarch64")] |
91 | mod arch { | |
532ac7d7 | 92 | use crate::os::raw::{c_uchar, c_ulong}; |
60c5eb7d | 93 | use crate::os::unix::raw::{gid_t, uid_t}; |
62682a34 | 94 | |
d9579d0f | 95 | #[stable(feature = "raw_ext", since = "1.1.0")] |
62682a34 | 96 | pub type dev_t = u64; |
d9579d0f | 97 | #[stable(feature = "raw_ext", since = "1.1.0")] |
62682a34 SL |
98 | pub type mode_t = u32; |
99 | ||
d9579d0f | 100 | #[stable(feature = "raw_ext", since = "1.1.0")] |
62682a34 | 101 | pub type blkcnt_t = u64; |
d9579d0f | 102 | #[stable(feature = "raw_ext", since = "1.1.0")] |
7453a54e | 103 | pub type blksize_t = u64; |
d9579d0f | 104 | #[stable(feature = "raw_ext", since = "1.1.0")] |
62682a34 | 105 | pub type ino_t = u64; |
d9579d0f | 106 | #[stable(feature = "raw_ext", since = "1.1.0")] |
7453a54e | 107 | pub type nlink_t = u64; |
d9579d0f | 108 | #[stable(feature = "raw_ext", since = "1.1.0")] |
7453a54e | 109 | pub type off_t = u64; |
d9579d0f | 110 | #[stable(feature = "raw_ext", since = "1.1.0")] |
62682a34 SL |
111 | pub type time_t = i64; |
112 | ||
113 | #[repr(C)] | |
b039eaaf | 114 | #[derive(Clone)] |
62682a34 SL |
115 | #[stable(feature = "raw_ext", since = "1.1.0")] |
116 | pub struct stat { | |
117 | #[stable(feature = "raw_ext", since = "1.1.0")] | |
118 | pub st_dev: dev_t, | |
119 | #[stable(feature = "raw_ext", since = "1.1.0")] | |
120 | pub __pad0: [c_uchar; 4], | |
121 | #[stable(feature = "raw_ext", since = "1.1.0")] | |
122 | pub __st_ino: ino_t, | |
123 | #[stable(feature = "raw_ext", since = "1.1.0")] | |
124 | pub st_mode: mode_t, | |
125 | #[stable(feature = "raw_ext", since = "1.1.0")] | |
126 | pub st_nlink: nlink_t, | |
127 | #[stable(feature = "raw_ext", since = "1.1.0")] | |
128 | pub st_uid: uid_t, | |
129 | #[stable(feature = "raw_ext", since = "1.1.0")] | |
130 | pub st_gid: gid_t, | |
131 | #[stable(feature = "raw_ext", since = "1.1.0")] | |
132 | pub st_rdev: dev_t, | |
133 | #[stable(feature = "raw_ext", since = "1.1.0")] | |
134 | pub __pad3: [c_uchar; 4], | |
135 | #[stable(feature = "raw_ext", since = "1.1.0")] | |
136 | pub st_size: off_t, | |
137 | #[stable(feature = "raw_ext", since = "1.1.0")] | |
138 | pub st_blksize: blksize_t, | |
139 | #[stable(feature = "raw_ext", since = "1.1.0")] | |
140 | pub st_blocks: blkcnt_t, | |
141 | #[stable(feature = "raw_ext", since = "1.1.0")] | |
142 | pub st_atime: time_t, | |
143 | #[stable(feature = "raw_ext", since = "1.1.0")] | |
144 | pub st_atime_nsec: c_ulong, | |
145 | #[stable(feature = "raw_ext", since = "1.1.0")] | |
146 | pub st_mtime: time_t, | |
147 | #[stable(feature = "raw_ext", since = "1.1.0")] | |
148 | pub st_mtime_nsec: c_ulong, | |
149 | #[stable(feature = "raw_ext", since = "1.1.0")] | |
150 | pub st_ctime: time_t, | |
151 | #[stable(feature = "raw_ext", since = "1.1.0")] | |
152 | pub st_ctime_nsec: c_ulong, | |
153 | #[stable(feature = "raw_ext", since = "1.1.0")] | |
154 | pub st_ino: ino_t, | |
155 | } | |
d9579d0f | 156 | } |
e9174d1e | 157 | |
cc61c64b XL |
158 | #[cfg(target_arch = "x86_64")] |
159 | mod arch { | |
60c5eb7d XL |
160 | use crate::os::raw::{c_long, c_uint, c_ulong}; |
161 | use crate::os::unix::raw::{gid_t, uid_t}; | |
cc61c64b XL |
162 | |
163 | #[stable(feature = "raw_ext", since = "1.1.0")] | |
164 | pub type dev_t = u64; | |
165 | #[stable(feature = "raw_ext", since = "1.1.0")] | |
166 | pub type mode_t = u32; | |
167 | ||
168 | #[stable(feature = "raw_ext", since = "1.1.0")] | |
169 | pub type blkcnt_t = u64; | |
170 | #[stable(feature = "raw_ext", since = "1.1.0")] | |
171 | pub type blksize_t = u64; | |
172 | #[stable(feature = "raw_ext", since = "1.1.0")] | |
173 | pub type ino_t = u64; | |
174 | #[stable(feature = "raw_ext", since = "1.1.0")] | |
175 | pub type nlink_t = u32; | |
176 | #[stable(feature = "raw_ext", since = "1.1.0")] | |
177 | pub type off_t = u64; | |
178 | #[stable(feature = "raw_ext", since = "1.1.0")] | |
179 | pub type time_t = i64; | |
180 | ||
181 | #[repr(C)] | |
182 | #[derive(Clone)] | |
183 | #[stable(feature = "raw_ext", since = "1.1.0")] | |
184 | pub struct stat { | |
185 | #[stable(feature = "raw_ext", since = "1.1.0")] | |
186 | pub st_dev: dev_t, | |
187 | #[stable(feature = "raw_ext", since = "1.1.0")] | |
188 | pub st_ino: ino_t, | |
189 | #[stable(feature = "raw_ext", since = "1.1.0")] | |
190 | pub st_nlink: c_ulong, | |
191 | #[stable(feature = "raw_ext", since = "1.1.0")] | |
192 | pub st_mode: c_uint, | |
193 | #[stable(feature = "raw_ext", since = "1.1.0")] | |
194 | pub st_uid: uid_t, | |
195 | #[stable(feature = "raw_ext", since = "1.1.0")] | |
196 | pub st_gid: gid_t, | |
197 | #[stable(feature = "raw_ext", since = "1.1.0")] | |
198 | pub st_rdev: dev_t, | |
199 | #[stable(feature = "raw_ext", since = "1.1.0")] | |
200 | pub st_size: i64, | |
201 | #[stable(feature = "raw_ext", since = "1.1.0")] | |
202 | pub st_blksize: c_long, | |
203 | #[stable(feature = "raw_ext", since = "1.1.0")] | |
204 | pub st_blocks: c_long, | |
205 | #[stable(feature = "raw_ext", since = "1.1.0")] | |
206 | pub st_atime: c_ulong, | |
207 | #[stable(feature = "raw_ext", since = "1.1.0")] | |
208 | pub st_atime_nsec: c_ulong, | |
209 | #[stable(feature = "raw_ext", since = "1.1.0")] | |
210 | pub st_mtime: c_ulong, | |
211 | #[stable(feature = "raw_ext", since = "1.1.0")] | |
212 | pub st_mtime_nsec: c_ulong, | |
213 | #[stable(feature = "raw_ext", since = "1.1.0")] | |
214 | pub st_ctime: c_ulong, | |
215 | #[stable(feature = "raw_ext", since = "1.1.0")] | |
216 | pub st_ctime_nsec: c_ulong, | |
217 | __unused: [c_long; 3], | |
218 | } | |
219 | } |