]> git.proxmox.com Git - rustc.git/blob - src/libstd/os/nacl/raw.rs
Imported Upstream version 1.1.0+dfsg1
[rustc.git] / src / libstd / os / nacl / raw.rs
1 // Copyright 2015 The Rust Project Developers. See the COPYRIGHT
2 // file at the top-level directory of this distribution and at
3 // http://rust-lang.org/COPYRIGHT.
4 //
5 // Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
6 // http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
7 // <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
8 // option. This file may not be copied, modified, or distributed
9 // except according to those terms.
10
11 //! Nacl-specific raw type definitions
12
13 #![stable(feature = "raw_ext", since = "1.1.0")]
14
15 #[stable(feature = "raw_ext", since = "1.1.0")] pub type dev_t = u64;
16 #[stable(feature = "raw_ext", since = "1.1.0")] pub type mode_t = u32;
17
18 pub use self::arch::{off_t, ino_t, nlink_t, blksize_t, blkcnt_t, stat, time_t};
19
20 #[cfg(any(target_arch = "x86",
21 target_arch = "le32",
22 target_arch = "powerpc",
23 target_arch = "arm"))]
24 mod arch {
25 use super::{dev_t, mode_t};
26 use os::raw::{c_long, c_short};
27 use os::unix::raw::{gid_t, uid_t};
28
29 #[stable(feature = "raw_ext", since = "1.1.0")] pub type blkcnt_t = i32;
30 #[stable(feature = "raw_ext", since = "1.1.0")] pub type blksize_t = i32;
31 #[stable(feature = "raw_ext", since = "1.1.0")] pub type ino_t = u32;
32 #[stable(feature = "raw_ext", since = "1.1.0")] pub type nlink_t = u32;
33 #[stable(feature = "raw_ext", since = "1.1.0")] pub type off_t = i32;
34 #[stable(feature = "raw_ext", since = "1.1.0")] pub type time_t = i32;
35
36 #[repr(C)]
37 #[stable(feature = "raw_ext", since = "1.1.0")]
38 pub struct stat {
39 #[stable(feature = "raw_ext", since = "1.1.0")]
40 pub st_dev: dev_t,
41 #[stable(feature = "raw_ext", since = "1.1.0")]
42 pub __pad1: c_short,
43 #[stable(feature = "raw_ext", since = "1.1.0")]
44 pub st_ino: ino_t,
45 #[stable(feature = "raw_ext", since = "1.1.0")]
46 pub st_mode: mode_t,
47 #[stable(feature = "raw_ext", since = "1.1.0")]
48 pub st_nlink: nlink_t,
49 #[stable(feature = "raw_ext", since = "1.1.0")]
50 pub st_uid: uid_t,
51 #[stable(feature = "raw_ext", since = "1.1.0")]
52 pub st_gid: gid_t,
53 #[stable(feature = "raw_ext", since = "1.1.0")]
54 pub st_rdev: dev_t,
55 #[stable(feature = "raw_ext", since = "1.1.0")]
56 pub __pad2: c_short,
57 #[stable(feature = "raw_ext", since = "1.1.0")]
58 pub st_size: off_t,
59 #[stable(feature = "raw_ext", since = "1.1.0")]
60 pub st_blksize: blksize_t,
61 #[stable(feature = "raw_ext", since = "1.1.0")]
62 pub st_blocks: blkcnt_t,
63 #[stable(feature = "raw_ext", since = "1.1.0")]
64 pub st_atime: time_t,
65 #[stable(feature = "raw_ext", since = "1.1.0")]
66 pub st_atime_nsec: c_long,
67 #[stable(feature = "raw_ext", since = "1.1.0")]
68 pub st_mtime: time_t,
69 #[stable(feature = "raw_ext", since = "1.1.0")]
70 pub st_mtime_nsec: c_long,
71 #[stable(feature = "raw_ext", since = "1.1.0")]
72 pub st_ctime: time_t,
73 #[stable(feature = "raw_ext", since = "1.1.0")]
74 pub st_ctime_nsec: c_long,
75 #[stable(feature = "raw_ext", since = "1.1.0")]
76 pub __unused4: c_long,
77 #[stable(feature = "raw_ext", since = "1.1.0")]
78 pub __unused5: c_long,
79 }
80 }
81
82 #[cfg(any(target_arch = "mips",
83 target_arch = "mipsel"))]
84 mod arch {
85 use super::{dev_t, mode_t};
86 use os::raw::c_long;
87 use os::unix::raw::{gid_t, uid_t};
88
89 #[stable(feature = "raw_ext", since = "1.1.0")] pub type blkcnt_t = i32;
90 #[stable(feature = "raw_ext", since = "1.1.0")] pub type blksize_t = i32;
91 #[stable(feature = "raw_ext", since = "1.1.0")] pub type ino_t = u32;
92 #[stable(feature = "raw_ext", since = "1.1.0")] pub type nlink_t = u32;
93 #[stable(feature = "raw_ext", since = "1.1.0")] pub type off_t = i32;
94 #[stable(feature = "raw_ext", since = "1.1.0")] pub type time_t = i32;
95
96 #[repr(C)]
97 #[stable(feature = "raw_ext", since = "1.1.0")]
98 pub struct stat {
99 #[stable(feature = "raw_ext", since = "1.1.0")]
100 pub st_dev: c_ulong,
101 #[stable(feature = "raw_ext", since = "1.1.0")]
102 pub st_pad1: [c_long; 3],
103 #[stable(feature = "raw_ext", since = "1.1.0")]
104 pub st_ino: ino_t,
105 #[stable(feature = "raw_ext", since = "1.1.0")]
106 pub st_mode: mode_t,
107 #[stable(feature = "raw_ext", since = "1.1.0")]
108 pub st_nlink: nlink_t,
109 #[stable(feature = "raw_ext", since = "1.1.0")]
110 pub st_uid: uid_t,
111 #[stable(feature = "raw_ext", since = "1.1.0")]
112 pub st_gid: gid_t,
113 #[stable(feature = "raw_ext", since = "1.1.0")]
114 pub st_rdev: c_ulong,
115 #[stable(feature = "raw_ext", since = "1.1.0")]
116 pub st_pad2: [c_long; 2],
117 #[stable(feature = "raw_ext", since = "1.1.0")]
118 pub st_size: off_t,
119 #[stable(feature = "raw_ext", since = "1.1.0")]
120 pub st_pad3: c_long,
121 #[stable(feature = "raw_ext", since = "1.1.0")]
122 pub st_atime: time_t,
123 #[stable(feature = "raw_ext", since = "1.1.0")]
124 pub st_atime_nsec: c_long,
125 #[stable(feature = "raw_ext", since = "1.1.0")]
126 pub st_mtime: time_t,
127 #[stable(feature = "raw_ext", since = "1.1.0")]
128 pub st_mtime_nsec: c_long,
129 #[stable(feature = "raw_ext", since = "1.1.0")]
130 pub st_ctime: time_t,
131 #[stable(feature = "raw_ext", since = "1.1.0")]
132 pub st_ctime_nsec: c_long,
133 #[stable(feature = "raw_ext", since = "1.1.0")]
134 pub st_blksize: blksize_t,
135 #[stable(feature = "raw_ext", since = "1.1.0")]
136 pub st_blocks: blkcnt_t,
137 #[stable(feature = "raw_ext", since = "1.1.0")]
138 pub st_pad5: [c_long; 14],
139 }
140 }
141
142 #[cfg(target_arch = "aarch64")]
143 mod arch {
144 use super::{dev_t, mode_t};
145 use os::raw::{c_long, c_int};
146 use os::unix::raw::{gid_t, uid_t};
147
148 #[stable(feature = "raw_ext", since = "1.1.0")] pub type blkcnt_t = i64;
149 #[stable(feature = "raw_ext", since = "1.1.0")] pub type blksize_t = i32;
150 #[stable(feature = "raw_ext", since = "1.1.0")] pub type ino_t = u64;
151 #[stable(feature = "raw_ext", since = "1.1.0")] pub type nlink_t = u32;
152 #[stable(feature = "raw_ext", since = "1.1.0")] pub type off_t = i64;
153 #[stable(feature = "raw_ext", since = "1.1.0")] pub type time_t = i64;
154
155 #[repr(C)]
156 #[stable(feature = "raw_ext", since = "1.1.0")]
157 pub struct stat {
158 #[stable(feature = "raw_ext", since = "1.1.0")]
159 pub st_dev: dev_t,
160 #[stable(feature = "raw_ext", since = "1.1.0")]
161 pub st_ino: ino_t,
162 #[stable(feature = "raw_ext", since = "1.1.0")]
163 pub st_mode: mode_t,
164 #[stable(feature = "raw_ext", since = "1.1.0")]
165 pub st_nlink: nlink_t,
166 #[stable(feature = "raw_ext", since = "1.1.0")]
167 pub st_uid: uid_t,
168 #[stable(feature = "raw_ext", since = "1.1.0")]
169 pub st_gid: gid_t,
170 #[stable(feature = "raw_ext", since = "1.1.0")]
171 pub st_rdev: dev_t,
172 #[stable(feature = "raw_ext", since = "1.1.0")]
173 pub __pad1: dev_t,
174 #[stable(feature = "raw_ext", since = "1.1.0")]
175 pub st_size: off_t,
176 #[stable(feature = "raw_ext", since = "1.1.0")]
177 pub st_blksize: blksize_t,
178 #[stable(feature = "raw_ext", since = "1.1.0")]
179 pub __pad2: c_int,
180 #[stable(feature = "raw_ext", since = "1.1.0")]
181 pub st_blocks: blkcnt_t,
182 #[stable(feature = "raw_ext", since = "1.1.0")]
183 pub st_atime: time_t,
184 #[stable(feature = "raw_ext", since = "1.1.0")]
185 pub st_atime_nsec: c_long,
186 #[stable(feature = "raw_ext", since = "1.1.0")]
187 pub st_mtime: time_t,
188 #[stable(feature = "raw_ext", since = "1.1.0")]
189 pub st_mtime_nsec: c_long,
190 #[stable(feature = "raw_ext", since = "1.1.0")]
191 pub st_ctime: time_t,
192 #[stable(feature = "raw_ext", since = "1.1.0")]
193 pub st_ctime_nsec: c_long,
194 #[stable(feature = "raw_ext", since = "1.1.0")]
195 pub __unused: [c_int; 2],
196 }
197 }
198
199 #[cfg(target_arch = "x86_64")]
200 mod arch {
201 use super::{dev_t, mode_t};
202 use os::raw::{c_long, c_int};
203 use os::unix::raw::{gid_t, uid_t};
204
205 #[stable(feature = "raw_ext", since = "1.1.0")] pub type blkcnt_t = i64;
206 #[stable(feature = "raw_ext", since = "1.1.0")] pub type blksize_t = i64;
207 #[stable(feature = "raw_ext", since = "1.1.0")] pub type ino_t = u64;
208 #[stable(feature = "raw_ext", since = "1.1.0")] pub type nlink_t = u64;
209 #[stable(feature = "raw_ext", since = "1.1.0")] pub type off_t = i64;
210 #[stable(feature = "raw_ext", since = "1.1.0")] pub type time_t = i64;
211
212 #[repr(C)]
213 #[stable(feature = "raw_ext", since = "1.1.0")]
214 pub struct stat {
215 #[stable(feature = "raw_ext", since = "1.1.0")]
216 pub st_dev: dev_t,
217 #[stable(feature = "raw_ext", since = "1.1.0")]
218 pub st_ino: ino_t,
219 #[stable(feature = "raw_ext", since = "1.1.0")]
220 pub st_nlink: nlink_t,
221 #[stable(feature = "raw_ext", since = "1.1.0")]
222 pub st_mode: mode_t,
223 #[stable(feature = "raw_ext", since = "1.1.0")]
224 pub st_uid: uid_t,
225 #[stable(feature = "raw_ext", since = "1.1.0")]
226 pub st_gid: gid_t,
227 #[stable(feature = "raw_ext", since = "1.1.0")]
228 pub __pad0: c_int,
229 #[stable(feature = "raw_ext", since = "1.1.0")]
230 pub st_rdev: dev_t,
231 #[stable(feature = "raw_ext", since = "1.1.0")]
232 pub st_size: off_t,
233 #[stable(feature = "raw_ext", since = "1.1.0")]
234 pub st_blksize: blksize_t,
235 #[stable(feature = "raw_ext", since = "1.1.0")]
236 pub st_blocks: blkcnt_t,
237 #[stable(feature = "raw_ext", since = "1.1.0")]
238 pub st_atime: time_t,
239 #[stable(feature = "raw_ext", since = "1.1.0")]
240 pub st_atime_nsec: c_long,
241 #[stable(feature = "raw_ext", since = "1.1.0")]
242 pub st_mtime: time_t,
243 #[stable(feature = "raw_ext", since = "1.1.0")]
244 pub st_mtime_nsec: c_long,
245 #[stable(feature = "raw_ext", since = "1.1.0")]
246 pub st_ctime: time_t,
247 #[stable(feature = "raw_ext", since = "1.1.0")]
248 pub st_ctime_nsec: c_long,
249 #[stable(feature = "raw_ext", since = "1.1.0")]
250 pub __unused: [c_long; 3],
251 }
252 }