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.
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.
11 //! Linux-specific raw type definitions
13 #![stable(feature = "raw_ext", since = "1.1.0")]
14 #![rustc_deprecated(since = "1.8.0",
15 reason = "these type aliases are no longer supported by \
16 the standard library, the `libc` crate on \
17 crates.io should be used instead for the correct \
20 #![allow(missing_debug_implementations)]
24 #[stable(feature = "raw_ext", since = "1.1.0")] pub type dev_t = u64;
25 #[stable(feature = "raw_ext", since = "1.1.0")] pub type mode_t = u32;
27 #[stable(feature = "pthread_t", since = "1.8.0")]
28 pub type pthread_t = c_ulong;
31 #[stable(feature = "raw_ext", since = "1.1.0")]
32 pub use self::arch::{off_t, ino_t, nlink_t, blksize_t, blkcnt_t, stat, time_t};
34 #[cfg(any(target_arch = "x86",
36 target_arch = "powerpc",
38 target_arch = "asmjs",
39 target_arch = "wasm32"))]
41 use os::raw::{c_long, c_short, c_uint};
43 #[stable(feature = "raw_ext", since = "1.1.0")] pub type blkcnt_t = u64;
44 #[stable(feature = "raw_ext", since = "1.1.0")] pub type blksize_t = u64;
45 #[stable(feature = "raw_ext", since = "1.1.0")] pub type ino_t = u64;
46 #[stable(feature = "raw_ext", since = "1.1.0")] pub type nlink_t = u64;
47 #[stable(feature = "raw_ext", since = "1.1.0")] pub type off_t = u64;
48 #[stable(feature = "raw_ext", since = "1.1.0")] pub type time_t = i64;
52 #[stable(feature = "raw_ext", since = "1.1.0")]
54 #[stable(feature = "raw_ext", since = "1.1.0")]
56 #[stable(feature = "raw_ext", since = "1.1.0")]
58 #[stable(feature = "raw_ext", since = "1.1.0")]
60 #[stable(feature = "raw_ext", since = "1.1.0")]
62 #[stable(feature = "raw_ext", since = "1.1.0")]
64 #[stable(feature = "raw_ext", since = "1.1.0")]
66 #[stable(feature = "raw_ext", since = "1.1.0")]
68 #[stable(feature = "raw_ext", since = "1.1.0")]
70 #[stable(feature = "raw_ext", since = "1.1.0")]
72 #[stable(feature = "raw_ext", since = "1.1.0")]
74 #[stable(feature = "raw_ext", since = "1.1.0")]
76 #[stable(feature = "raw_ext", since = "1.1.0")]
78 #[stable(feature = "raw_ext", since = "1.1.0")]
80 #[stable(feature = "raw_ext", since = "1.1.0")]
81 pub st_atime_nsec: c_long,
82 #[stable(feature = "raw_ext", since = "1.1.0")]
84 #[stable(feature = "raw_ext", since = "1.1.0")]
85 pub st_mtime_nsec: c_long,
86 #[stable(feature = "raw_ext", since = "1.1.0")]
88 #[stable(feature = "raw_ext", since = "1.1.0")]
89 pub st_ctime_nsec: c_long,
90 #[stable(feature = "raw_ext", since = "1.1.0")]
95 #[cfg(target_arch = "mips")]
97 use os::raw::{c_long, c_ulong};
99 #[cfg(target_env = "musl")]
100 #[stable(feature = "raw_ext", since = "1.1.0")] pub type blkcnt_t = i64;
101 #[cfg(not(target_env = "musl"))]
102 #[stable(feature = "raw_ext", since = "1.1.0")] pub type blkcnt_t = u64;
103 #[stable(feature = "raw_ext", since = "1.1.0")] pub type blksize_t = u64;
104 #[cfg(target_env = "musl")]
105 #[stable(feature = "raw_ext", since = "1.1.0")] pub type ino_t = u64;
106 #[cfg(not(target_env = "musl"))]
107 #[stable(feature = "raw_ext", since = "1.1.0")] pub type ino_t = u64;
108 #[stable(feature = "raw_ext", since = "1.1.0")] pub type nlink_t = u64;
109 #[cfg(target_env = "musl")]
110 #[stable(feature = "raw_ext", since = "1.1.0")] pub type off_t = u64;
111 #[cfg(not(target_env = "musl"))]
112 #[stable(feature = "raw_ext", since = "1.1.0")] pub type off_t = u64;
113 #[stable(feature = "raw_ext", since = "1.1.0")] pub type time_t = i64;
117 #[stable(feature = "raw_ext", since = "1.1.0")]
119 #[stable(feature = "raw_ext", since = "1.1.0")]
121 #[stable(feature = "raw_ext", since = "1.1.0")]
122 pub st_pad1: [c_long; 3],
123 #[stable(feature = "raw_ext", since = "1.1.0")]
125 #[stable(feature = "raw_ext", since = "1.1.0")]
127 #[stable(feature = "raw_ext", since = "1.1.0")]
129 #[stable(feature = "raw_ext", since = "1.1.0")]
131 #[stable(feature = "raw_ext", since = "1.1.0")]
133 #[stable(feature = "raw_ext", since = "1.1.0")]
134 pub st_rdev: c_ulong,
135 #[stable(feature = "raw_ext", since = "1.1.0")]
136 pub st_pad2: [c_long; 2],
137 #[stable(feature = "raw_ext", since = "1.1.0")]
139 #[stable(feature = "raw_ext", since = "1.1.0")]
141 #[stable(feature = "raw_ext", since = "1.1.0")]
142 pub st_atime_nsec: c_long,
143 #[stable(feature = "raw_ext", since = "1.1.0")]
145 #[stable(feature = "raw_ext", since = "1.1.0")]
146 pub st_mtime_nsec: c_long,
147 #[stable(feature = "raw_ext", since = "1.1.0")]
149 #[stable(feature = "raw_ext", since = "1.1.0")]
150 pub st_ctime_nsec: c_long,
151 #[stable(feature = "raw_ext", since = "1.1.0")]
153 #[stable(feature = "raw_ext", since = "1.1.0")]
155 #[stable(feature = "raw_ext", since = "1.1.0")]
156 pub st_pad5: [c_long; 14],
160 #[cfg(target_arch = "mips64")]
162 pub use libc::{off_t, ino_t, nlink_t, blksize_t, blkcnt_t, stat, time_t};
165 #[cfg(target_arch = "s390x")]
167 pub use libc::{off_t, ino_t, nlink_t, blksize_t, blkcnt_t, stat, time_t};
170 #[cfg(target_arch = "aarch64")]
172 use os::raw::{c_long, c_int};
174 #[stable(feature = "raw_ext", since = "1.1.0")] pub type blkcnt_t = u64;
175 #[stable(feature = "raw_ext", since = "1.1.0")] pub type blksize_t = u64;
176 #[stable(feature = "raw_ext", since = "1.1.0")] pub type ino_t = u64;
177 #[stable(feature = "raw_ext", since = "1.1.0")] pub type nlink_t = u64;
178 #[stable(feature = "raw_ext", since = "1.1.0")] pub type off_t = u64;
179 #[stable(feature = "raw_ext", since = "1.1.0")] pub type time_t = i64;
183 #[stable(feature = "raw_ext", since = "1.1.0")]
185 #[stable(feature = "raw_ext", since = "1.1.0")]
187 #[stable(feature = "raw_ext", since = "1.1.0")]
189 #[stable(feature = "raw_ext", since = "1.1.0")]
191 #[stable(feature = "raw_ext", since = "1.1.0")]
193 #[stable(feature = "raw_ext", since = "1.1.0")]
195 #[stable(feature = "raw_ext", since = "1.1.0")]
197 #[stable(feature = "raw_ext", since = "1.1.0")]
199 #[stable(feature = "raw_ext", since = "1.1.0")]
201 #[stable(feature = "raw_ext", since = "1.1.0")]
203 #[stable(feature = "raw_ext", since = "1.1.0")]
205 #[stable(feature = "raw_ext", since = "1.1.0")]
207 #[stable(feature = "raw_ext", since = "1.1.0")]
209 #[stable(feature = "raw_ext", since = "1.1.0")]
211 #[stable(feature = "raw_ext", since = "1.1.0")]
212 pub st_atime_nsec: c_long,
213 #[stable(feature = "raw_ext", since = "1.1.0")]
215 #[stable(feature = "raw_ext", since = "1.1.0")]
216 pub st_mtime_nsec: c_long,
217 #[stable(feature = "raw_ext", since = "1.1.0")]
219 #[stable(feature = "raw_ext", since = "1.1.0")]
220 pub st_ctime_nsec: c_long,
221 #[stable(feature = "raw_ext", since = "1.1.0")]
222 pub __unused: [c_int; 2],
226 #[cfg(any(target_arch = "x86_64", target_arch = "powerpc64"))]
228 use os::raw::{c_long, c_int};
230 #[stable(feature = "raw_ext", since = "1.1.0")] pub type blkcnt_t = u64;
231 #[stable(feature = "raw_ext", since = "1.1.0")] pub type blksize_t = u64;
232 #[stable(feature = "raw_ext", since = "1.1.0")] pub type ino_t = u64;
233 #[stable(feature = "raw_ext", since = "1.1.0")] pub type nlink_t = u64;
234 #[stable(feature = "raw_ext", since = "1.1.0")] pub type off_t = u64;
235 #[stable(feature = "raw_ext", since = "1.1.0")] pub type time_t = i64;
239 #[stable(feature = "raw_ext", since = "1.1.0")]
241 #[stable(feature = "raw_ext", since = "1.1.0")]
243 #[stable(feature = "raw_ext", since = "1.1.0")]
245 #[stable(feature = "raw_ext", since = "1.1.0")]
247 #[stable(feature = "raw_ext", since = "1.1.0")]
249 #[stable(feature = "raw_ext", since = "1.1.0")]
251 #[stable(feature = "raw_ext", since = "1.1.0")]
253 #[stable(feature = "raw_ext", since = "1.1.0")]
255 #[stable(feature = "raw_ext", since = "1.1.0")]
257 #[stable(feature = "raw_ext", since = "1.1.0")]
259 #[stable(feature = "raw_ext", since = "1.1.0")]
261 #[stable(feature = "raw_ext", since = "1.1.0")]
263 #[stable(feature = "raw_ext", since = "1.1.0")]
265 #[stable(feature = "raw_ext", since = "1.1.0")]
266 pub st_atime_nsec: c_long,
267 #[stable(feature = "raw_ext", since = "1.1.0")]
269 #[stable(feature = "raw_ext", since = "1.1.0")]
270 pub st_mtime_nsec: c_long,
271 #[stable(feature = "raw_ext", since = "1.1.0")]
273 #[stable(feature = "raw_ext", since = "1.1.0")]
274 pub st_ctime_nsec: c_long,
275 #[stable(feature = "raw_ext", since = "1.1.0")]
276 pub __unused: [c_long; 3],