]> git.lizzy.rs Git - rust.git/blob - library/std/src/os/android/raw.rs
Auto merge of #104205 - clubby789:grow-rc, r=thomcc
[rust.git] / library / std / src / os / android / raw.rs
1 //! Android-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_long;
14
15 #[stable(feature = "pthread_t", since = "1.8.0")]
16 pub type pthread_t = c_long;
17
18 #[doc(inline)]
19 #[stable(feature = "raw_ext", since = "1.1.0")]
20 pub use self::arch::{blkcnt_t, blksize_t, dev_t, ino_t, mode_t, nlink_t, off_t, stat, time_t};
21
22 #[cfg(any(target_arch = "arm", target_arch = "x86"))]
23 mod arch {
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};
26
27     #[stable(feature = "raw_ext", since = "1.1.0")]
28     pub type dev_t = u64;
29     #[stable(feature = "raw_ext", since = "1.1.0")]
30     pub type mode_t = u32;
31
32     #[stable(feature = "raw_ext", since = "1.1.0")]
33     pub type blkcnt_t = u64;
34     #[stable(feature = "raw_ext", since = "1.1.0")]
35     pub type blksize_t = u64;
36     #[stable(feature = "raw_ext", since = "1.1.0")]
37     pub type ino_t = u64;
38     #[stable(feature = "raw_ext", since = "1.1.0")]
39     pub type nlink_t = u64;
40     #[stable(feature = "raw_ext", since = "1.1.0")]
41     pub type off_t = u64;
42     #[stable(feature = "raw_ext", since = "1.1.0")]
43     pub type time_t = i64;
44
45     #[repr(C)]
46     #[derive(Clone)]
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")]
54         pub __st_ino: u32,
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")]
70         pub st_blksize: u32,
71         #[stable(feature = "raw_ext", since = "1.1.0")]
72         pub st_blocks: c_ulonglong,
73         #[stable(feature = "raw_ext", since = "1.1.0")]
74         pub st_atime: c_ulong,
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")]
78         pub st_mtime: c_ulong,
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")]
82         pub st_ctime: c_ulong,
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     }
88 }
89
90 #[cfg(target_arch = "aarch64")]
91 mod arch {
92     use crate::os::raw::{c_uchar, c_ulong};
93     use crate::os::unix::raw::{gid_t, uid_t};
94
95     #[stable(feature = "raw_ext", since = "1.1.0")]
96     pub type dev_t = u64;
97     #[stable(feature = "raw_ext", since = "1.1.0")]
98     pub type mode_t = u32;
99
100     #[stable(feature = "raw_ext", since = "1.1.0")]
101     pub type blkcnt_t = u64;
102     #[stable(feature = "raw_ext", since = "1.1.0")]
103     pub type blksize_t = u64;
104     #[stable(feature = "raw_ext", since = "1.1.0")]
105     pub type ino_t = u64;
106     #[stable(feature = "raw_ext", since = "1.1.0")]
107     pub type nlink_t = u64;
108     #[stable(feature = "raw_ext", since = "1.1.0")]
109     pub type off_t = u64;
110     #[stable(feature = "raw_ext", since = "1.1.0")]
111     pub type time_t = i64;
112
113     #[repr(C)]
114     #[derive(Clone)]
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     }
156 }
157
158 #[cfg(target_arch = "x86_64")]
159 mod arch {
160     use crate::os::raw::{c_long, c_uint, c_ulong};
161     use crate::os::unix::raw::{gid_t, uid_t};
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 }