]> git.lizzy.rs Git - rust.git/blob - library/std/src/os/fuchsia/raw.rs
Auto merge of #107443 - cjgillot:generator-less-query, r=compiler-errors
[rust.git] / library / std / src / os / fuchsia / raw.rs
1 //! Fuchsia-specific raw type definitions
2
3 #![stable(feature = "raw_ext", since = "1.1.0")]
4 #![deprecated(
5     since = "1.8.0",
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"
10 )]
11 #![allow(deprecated)]
12
13 use crate::os::raw::c_ulong;
14
15 #[stable(feature = "raw_ext", since = "1.1.0")]
16 pub type dev_t = u64;
17 #[stable(feature = "raw_ext", since = "1.1.0")]
18 pub type mode_t = u32;
19
20 #[stable(feature = "pthread_t", since = "1.8.0")]
21 pub type pthread_t = c_ulong;
22
23 #[doc(inline)]
24 #[stable(feature = "raw_ext", since = "1.1.0")]
25 pub use self::arch::{blkcnt_t, blksize_t, ino_t, nlink_t, off_t, stat, time_t};
26
27 #[cfg(any(target_arch = "x86", target_arch = "powerpc", target_arch = "arm"))]
28 mod arch {
29     use crate::os::raw::{c_long, c_short, c_uint};
30
31     #[stable(feature = "raw_ext", since = "1.1.0")]
32     pub type blkcnt_t = u64;
33     #[stable(feature = "raw_ext", since = "1.1.0")]
34     pub type blksize_t = u64;
35     #[stable(feature = "raw_ext", since = "1.1.0")]
36     pub type ino_t = u64;
37     #[stable(feature = "raw_ext", since = "1.1.0")]
38     pub type nlink_t = u64;
39     #[stable(feature = "raw_ext", since = "1.1.0")]
40     pub type off_t = u64;
41     #[stable(feature = "raw_ext", since = "1.1.0")]
42     pub type time_t = i64;
43
44     #[repr(C)]
45     #[derive(Clone)]
46     #[stable(feature = "raw_ext", since = "1.1.0")]
47     pub struct stat {
48         #[stable(feature = "raw_ext", since = "1.1.0")]
49         pub st_dev: u64,
50         #[stable(feature = "raw_ext", since = "1.1.0")]
51         pub __pad1: c_short,
52         #[stable(feature = "raw_ext", since = "1.1.0")]
53         pub __st_ino: u32,
54         #[stable(feature = "raw_ext", since = "1.1.0")]
55         pub st_mode: u32,
56         #[stable(feature = "raw_ext", since = "1.1.0")]
57         pub st_nlink: u32,
58         #[stable(feature = "raw_ext", since = "1.1.0")]
59         pub st_uid: u32,
60         #[stable(feature = "raw_ext", since = "1.1.0")]
61         pub st_gid: u32,
62         #[stable(feature = "raw_ext", since = "1.1.0")]
63         pub st_rdev: u64,
64         #[stable(feature = "raw_ext", since = "1.1.0")]
65         pub __pad2: c_uint,
66         #[stable(feature = "raw_ext", since = "1.1.0")]
67         pub st_size: i64,
68         #[stable(feature = "raw_ext", since = "1.1.0")]
69         pub st_blksize: i32,
70         #[stable(feature = "raw_ext", since = "1.1.0")]
71         pub st_blocks: i64,
72         #[stable(feature = "raw_ext", since = "1.1.0")]
73         pub st_atime: i32,
74         #[stable(feature = "raw_ext", since = "1.1.0")]
75         pub st_atime_nsec: c_long,
76         #[stable(feature = "raw_ext", since = "1.1.0")]
77         pub st_mtime: i32,
78         #[stable(feature = "raw_ext", since = "1.1.0")]
79         pub st_mtime_nsec: c_long,
80         #[stable(feature = "raw_ext", since = "1.1.0")]
81         pub st_ctime: i32,
82         #[stable(feature = "raw_ext", since = "1.1.0")]
83         pub st_ctime_nsec: c_long,
84         #[stable(feature = "raw_ext", since = "1.1.0")]
85         pub st_ino: u64,
86     }
87 }
88
89 #[cfg(target_arch = "mips")]
90 mod arch {
91     use crate::os::raw::{c_long, c_ulong};
92
93     #[cfg(target_env = "musl")]
94     #[stable(feature = "raw_ext", since = "1.1.0")]
95     pub type blkcnt_t = i64;
96     #[cfg(not(target_env = "musl"))]
97     #[stable(feature = "raw_ext", since = "1.1.0")]
98     pub type blkcnt_t = u64;
99     #[stable(feature = "raw_ext", since = "1.1.0")]
100     pub type blksize_t = u64;
101     #[cfg(target_env = "musl")]
102     #[stable(feature = "raw_ext", since = "1.1.0")]
103     pub type ino_t = u64;
104     #[cfg(not(target_env = "musl"))]
105     #[stable(feature = "raw_ext", since = "1.1.0")]
106     pub type ino_t = u64;
107     #[stable(feature = "raw_ext", since = "1.1.0")]
108     pub type nlink_t = u64;
109     #[cfg(target_env = "musl")]
110     #[stable(feature = "raw_ext", since = "1.1.0")]
111     pub type off_t = u64;
112     #[cfg(not(target_env = "musl"))]
113     #[stable(feature = "raw_ext", since = "1.1.0")]
114     pub type off_t = u64;
115     #[stable(feature = "raw_ext", since = "1.1.0")]
116     pub type time_t = i64;
117
118     #[repr(C)]
119     #[derive(Clone)]
120     #[stable(feature = "raw_ext", since = "1.1.0")]
121     pub struct stat {
122         #[stable(feature = "raw_ext", since = "1.1.0")]
123         pub st_dev: c_ulong,
124         #[stable(feature = "raw_ext", since = "1.1.0")]
125         pub st_pad1: [c_long; 3],
126         #[stable(feature = "raw_ext", since = "1.1.0")]
127         pub st_ino: u64,
128         #[stable(feature = "raw_ext", since = "1.1.0")]
129         pub st_mode: u32,
130         #[stable(feature = "raw_ext", since = "1.1.0")]
131         pub st_nlink: u32,
132         #[stable(feature = "raw_ext", since = "1.1.0")]
133         pub st_uid: u32,
134         #[stable(feature = "raw_ext", since = "1.1.0")]
135         pub st_gid: u32,
136         #[stable(feature = "raw_ext", since = "1.1.0")]
137         pub st_rdev: c_ulong,
138         #[stable(feature = "raw_ext", since = "1.1.0")]
139         pub st_pad2: [c_long; 2],
140         #[stable(feature = "raw_ext", since = "1.1.0")]
141         pub st_size: i64,
142         #[stable(feature = "raw_ext", since = "1.1.0")]
143         pub st_atime: i32,
144         #[stable(feature = "raw_ext", since = "1.1.0")]
145         pub st_atime_nsec: c_long,
146         #[stable(feature = "raw_ext", since = "1.1.0")]
147         pub st_mtime: i32,
148         #[stable(feature = "raw_ext", since = "1.1.0")]
149         pub st_mtime_nsec: c_long,
150         #[stable(feature = "raw_ext", since = "1.1.0")]
151         pub st_ctime: i32,
152         #[stable(feature = "raw_ext", since = "1.1.0")]
153         pub st_ctime_nsec: c_long,
154         #[stable(feature = "raw_ext", since = "1.1.0")]
155         pub st_blksize: i32,
156         #[stable(feature = "raw_ext", since = "1.1.0")]
157         pub st_blocks: i64,
158         #[stable(feature = "raw_ext", since = "1.1.0")]
159         pub st_pad5: [c_long; 14],
160     }
161 }
162
163 #[cfg(target_arch = "mips64")]
164 mod arch {
165     pub use libc::{blkcnt_t, blksize_t, ino_t, nlink_t, off_t, stat, time_t};
166 }
167
168 #[cfg(target_arch = "aarch64")]
169 mod arch {
170     use crate::os::raw::{c_int, c_long};
171
172     #[stable(feature = "raw_ext", since = "1.1.0")]
173     pub type blkcnt_t = u64;
174     #[stable(feature = "raw_ext", since = "1.1.0")]
175     pub type blksize_t = u64;
176     #[stable(feature = "raw_ext", since = "1.1.0")]
177     pub type ino_t = u64;
178     #[stable(feature = "raw_ext", since = "1.1.0")]
179     pub type nlink_t = u64;
180     #[stable(feature = "raw_ext", since = "1.1.0")]
181     pub type off_t = u64;
182     #[stable(feature = "raw_ext", since = "1.1.0")]
183     pub type time_t = i64;
184
185     #[repr(C)]
186     #[derive(Clone)]
187     #[stable(feature = "raw_ext", since = "1.1.0")]
188     pub struct stat {
189         #[stable(feature = "raw_ext", since = "1.1.0")]
190         pub st_dev: u64,
191         #[stable(feature = "raw_ext", since = "1.1.0")]
192         pub st_ino: u64,
193         #[stable(feature = "raw_ext", since = "1.1.0")]
194         pub st_mode: u32,
195         #[stable(feature = "raw_ext", since = "1.1.0")]
196         pub st_nlink: u32,
197         #[stable(feature = "raw_ext", since = "1.1.0")]
198         pub st_uid: u32,
199         #[stable(feature = "raw_ext", since = "1.1.0")]
200         pub st_gid: u32,
201         #[stable(feature = "raw_ext", since = "1.1.0")]
202         pub st_rdev: u64,
203         #[stable(feature = "raw_ext", since = "1.1.0")]
204         pub __pad1: u64,
205         #[stable(feature = "raw_ext", since = "1.1.0")]
206         pub st_size: i64,
207         #[stable(feature = "raw_ext", since = "1.1.0")]
208         pub st_blksize: i32,
209         #[stable(feature = "raw_ext", since = "1.1.0")]
210         pub __pad2: c_int,
211         #[stable(feature = "raw_ext", since = "1.1.0")]
212         pub st_blocks: i64,
213         #[stable(feature = "raw_ext", since = "1.1.0")]
214         pub st_atime: i64,
215         #[stable(feature = "raw_ext", since = "1.1.0")]
216         pub st_atime_nsec: c_long,
217         #[stable(feature = "raw_ext", since = "1.1.0")]
218         pub st_mtime: i64,
219         #[stable(feature = "raw_ext", since = "1.1.0")]
220         pub st_mtime_nsec: c_long,
221         #[stable(feature = "raw_ext", since = "1.1.0")]
222         pub st_ctime: i64,
223         #[stable(feature = "raw_ext", since = "1.1.0")]
224         pub st_ctime_nsec: c_long,
225         #[stable(feature = "raw_ext", since = "1.1.0")]
226         pub __unused: [c_int; 2],
227     }
228 }
229
230 #[cfg(target_arch = "x86_64")]
231 mod arch {
232     use crate::os::raw::{c_int, c_long};
233
234     #[stable(feature = "raw_ext", since = "1.1.0")]
235     pub type blkcnt_t = u64;
236     #[stable(feature = "raw_ext", since = "1.1.0")]
237     pub type blksize_t = u64;
238     #[stable(feature = "raw_ext", since = "1.1.0")]
239     pub type ino_t = u64;
240     #[stable(feature = "raw_ext", since = "1.1.0")]
241     pub type nlink_t = u64;
242     #[stable(feature = "raw_ext", since = "1.1.0")]
243     pub type off_t = u64;
244     #[stable(feature = "raw_ext", since = "1.1.0")]
245     pub type time_t = i64;
246
247     #[repr(C)]
248     #[derive(Clone)]
249     #[stable(feature = "raw_ext", since = "1.1.0")]
250     pub struct stat {
251         #[stable(feature = "raw_ext", since = "1.1.0")]
252         pub st_dev: u64,
253         #[stable(feature = "raw_ext", since = "1.1.0")]
254         pub st_ino: u64,
255         #[stable(feature = "raw_ext", since = "1.1.0")]
256         pub st_nlink: u64,
257         #[stable(feature = "raw_ext", since = "1.1.0")]
258         pub st_mode: u32,
259         #[stable(feature = "raw_ext", since = "1.1.0")]
260         pub st_uid: u32,
261         #[stable(feature = "raw_ext", since = "1.1.0")]
262         pub st_gid: u32,
263         #[stable(feature = "raw_ext", since = "1.1.0")]
264         pub __pad0: c_int,
265         #[stable(feature = "raw_ext", since = "1.1.0")]
266         pub st_rdev: u64,
267         #[stable(feature = "raw_ext", since = "1.1.0")]
268         pub st_size: i64,
269         #[stable(feature = "raw_ext", since = "1.1.0")]
270         pub st_blksize: i64,
271         #[stable(feature = "raw_ext", since = "1.1.0")]
272         pub st_blocks: i64,
273         #[stable(feature = "raw_ext", since = "1.1.0")]
274         pub st_atime: i64,
275         #[stable(feature = "raw_ext", since = "1.1.0")]
276         pub st_atime_nsec: c_long,
277         #[stable(feature = "raw_ext", since = "1.1.0")]
278         pub st_mtime: i64,
279         #[stable(feature = "raw_ext", since = "1.1.0")]
280         pub st_mtime_nsec: c_long,
281         #[stable(feature = "raw_ext", since = "1.1.0")]
282         pub st_ctime: i64,
283         #[stable(feature = "raw_ext", since = "1.1.0")]
284         pub st_ctime_nsec: c_long,
285         #[stable(feature = "raw_ext", since = "1.1.0")]
286         pub __unused: [c_long; 3],
287     }
288 }