]> git.proxmox.com Git - rustc.git/blob - src/libstd/os/freebsd/raw.rs
Imported Upstream version 1.6.0+dfsg1
[rustc.git] / src / libstd / os / freebsd / 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 //! FreeBSD-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 off_t = i64;
16 #[stable(feature = "raw_ext", since = "1.1.0")] pub type dev_t = u32;
17 #[stable(feature = "raw_ext", since = "1.1.0")] pub type ino_t = u32;
18 #[stable(feature = "raw_ext", since = "1.1.0")] pub type mode_t = u16;
19 #[stable(feature = "raw_ext", since = "1.1.0")] pub type nlink_t = u16;
20 #[stable(feature = "raw_ext", since = "1.1.0")] pub type blksize_t = u32;
21 #[stable(feature = "raw_ext", since = "1.1.0")] pub type blkcnt_t = i64;
22 #[stable(feature = "raw_ext", since = "1.1.0")] pub type fflags_t = u32;
23
24 #[unstable(feature = "pthread_t", issue = "29791")] pub type pthread_t = usize;
25
26 #[doc(inline)]
27 #[stable(feature = "raw_ext", since = "1.1.0")]
28 pub use self::arch::{stat, time_t};
29
30 #[cfg(target_arch = "x86")]
31 mod arch {
32 use super::{off_t, dev_t, ino_t, mode_t, nlink_t, blksize_t, blkcnt_t, fflags_t};
33 use os::raw::c_long;
34 use os::unix::raw::{uid_t, gid_t};
35
36 #[stable(feature = "raw_ext", since = "1.1.0")] pub type time_t = i32;
37
38 #[repr(C)]
39 #[derive(Clone)]
40 #[stable(feature = "raw_ext", since = "1.1.0")]
41 pub struct stat {
42 #[stable(feature = "raw_ext", since = "1.1.0")]
43 pub st_dev: dev_t,
44 #[stable(feature = "raw_ext", since = "1.1.0")]
45 pub st_ino: ino_t,
46 #[stable(feature = "raw_ext", since = "1.1.0")]
47 pub st_mode: mode_t,
48 #[stable(feature = "raw_ext", since = "1.1.0")]
49 pub st_nlink: nlink_t,
50 #[stable(feature = "raw_ext", since = "1.1.0")]
51 pub st_uid: uid_t,
52 #[stable(feature = "raw_ext", since = "1.1.0")]
53 pub st_gid: gid_t,
54 #[stable(feature = "raw_ext", since = "1.1.0")]
55 pub st_rdev: dev_t,
56 #[stable(feature = "raw_ext", since = "1.1.0")]
57 pub st_atime: time_t,
58 #[stable(feature = "raw_ext", since = "1.1.0")]
59 pub st_atime_nsec: c_long,
60 #[stable(feature = "raw_ext", since = "1.1.0")]
61 pub st_mtime: time_t,
62 #[stable(feature = "raw_ext", since = "1.1.0")]
63 pub st_mtime_nsec: c_long,
64 #[stable(feature = "raw_ext", since = "1.1.0")]
65 pub st_ctime: time_t,
66 #[stable(feature = "raw_ext", since = "1.1.0")]
67 pub st_ctime_nsec: c_long,
68 #[stable(feature = "raw_ext", since = "1.1.0")]
69 pub st_size: off_t,
70 #[stable(feature = "raw_ext", since = "1.1.0")]
71 pub st_blocks: blkcnt_t,
72 #[stable(feature = "raw_ext", since = "1.1.0")]
73 pub st_blksize: blksize_t,
74 #[stable(feature = "raw_ext", since = "1.1.0")]
75 pub st_flags: fflags_t,
76 #[stable(feature = "raw_ext", since = "1.1.0")]
77 pub st_gen: u32,
78 #[stable(feature = "raw_ext", since = "1.1.0")]
79 pub st_lspare: i32,
80 #[stable(feature = "raw_ext", since = "1.1.0")]
81 pub st_birthtime: time_t,
82 #[stable(feature = "raw_ext", since = "1.1.0")]
83 pub st_birthtime_nsec: c_long,
84 #[stable(feature = "raw_ext", since = "1.1.0")]
85 pub __unused: [u8; 8],
86 }
87 }
88
89 #[cfg(target_arch = "x86_64")]
90 mod arch {
91 use super::{off_t, dev_t, ino_t, mode_t, nlink_t, blksize_t, blkcnt_t, fflags_t};
92 use os::raw::c_long;
93 use os::unix::raw::{uid_t, gid_t};
94
95 #[stable(feature = "raw_ext", since = "1.1.0")] pub type time_t = i64;
96
97 #[repr(C)]
98 #[derive(Clone)]
99 #[stable(feature = "raw_ext", since = "1.1.0")]
100 pub struct stat {
101 #[stable(feature = "raw_ext", since = "1.1.0")]
102 pub st_dev: dev_t,
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: dev_t,
115 #[stable(feature = "raw_ext", since = "1.1.0")]
116 pub st_atime: time_t,
117 #[stable(feature = "raw_ext", since = "1.1.0")]
118 pub st_atime_nsec: c_long,
119 #[stable(feature = "raw_ext", since = "1.1.0")]
120 pub st_mtime: time_t,
121 #[stable(feature = "raw_ext", since = "1.1.0")]
122 pub st_mtime_nsec: c_long,
123 #[stable(feature = "raw_ext", since = "1.1.0")]
124 pub st_ctime: time_t,
125 #[stable(feature = "raw_ext", since = "1.1.0")]
126 pub st_ctime_nsec: c_long,
127 #[stable(feature = "raw_ext", since = "1.1.0")]
128 pub st_size: off_t,
129 #[stable(feature = "raw_ext", since = "1.1.0")]
130 pub st_blocks: blkcnt_t,
131 #[stable(feature = "raw_ext", since = "1.1.0")]
132 pub st_blksize: blksize_t,
133 #[stable(feature = "raw_ext", since = "1.1.0")]
134 pub st_flags: fflags_t,
135 #[stable(feature = "raw_ext", since = "1.1.0")]
136 pub st_gen: u32,
137 #[stable(feature = "raw_ext", since = "1.1.0")]
138 pub st_lspare: i32,
139 #[stable(feature = "raw_ext", since = "1.1.0")]
140 pub st_birthtime: time_t,
141 #[stable(feature = "raw_ext", since = "1.1.0")]
142 pub st_birthtime_nsec: c_long,
143 }
144 }
145