1 | //! Mostly platform-specific functionality |
2 | #[cfg (any( |
3 | target_os = "dragonfly" , |
4 | target_os = "freebsd" , |
5 | target_os = "ios" , |
6 | all(target_os = "linux" , not(target_env = "uclibc" )), |
7 | target_os = "macos" , |
8 | target_os = "netbsd" |
9 | ))] |
10 | feature! { |
11 | #![feature = "aio" ] |
12 | pub mod aio; |
13 | } |
14 | |
15 | feature! { |
16 | #![feature = "event" ] |
17 | |
18 | #[cfg (any(target_os = "android" , target_os = "linux" ))] |
19 | #[allow (missing_docs)] |
20 | pub mod epoll; |
21 | |
22 | #[cfg (any(target_os = "dragonfly" , |
23 | target_os = "freebsd" , |
24 | target_os = "ios" , |
25 | target_os = "macos" , |
26 | target_os = "netbsd" , |
27 | target_os = "openbsd" ))] |
28 | pub mod event; |
29 | |
30 | #[cfg (any(target_os = "android" , target_os = "linux" ))] |
31 | #[allow (missing_docs)] |
32 | pub mod eventfd; |
33 | } |
34 | |
35 | #[cfg (any( |
36 | target_os = "android" , |
37 | target_os = "dragonfly" , |
38 | target_os = "freebsd" , |
39 | target_os = "ios" , |
40 | target_os = "linux" , |
41 | target_os = "redox" , |
42 | target_os = "macos" , |
43 | target_os = "netbsd" , |
44 | target_os = "illumos" , |
45 | target_os = "openbsd" |
46 | ))] |
47 | #[cfg (feature = "ioctl" )] |
48 | #[cfg_attr (docsrs, doc(cfg(feature = "ioctl" )))] |
49 | #[macro_use ] |
50 | pub mod ioctl; |
51 | |
52 | #[cfg (any(target_os = "android" , target_os = "freebsd" , target_os = "linux" ))] |
53 | feature! { |
54 | #![feature = "fs" ] |
55 | pub mod memfd; |
56 | } |
57 | |
58 | #[cfg (not(target_os = "redox" ))] |
59 | feature! { |
60 | #![feature = "mman" ] |
61 | pub mod mman; |
62 | } |
63 | |
64 | #[cfg (target_os = "linux" )] |
65 | feature! { |
66 | #![feature = "personality" ] |
67 | pub mod personality; |
68 | } |
69 | |
70 | #[cfg (target_os = "linux" )] |
71 | feature! { |
72 | #![feature = "process" ] |
73 | pub mod prctl; |
74 | } |
75 | |
76 | feature! { |
77 | #![feature = "pthread" ] |
78 | pub mod pthread; |
79 | } |
80 | |
81 | #[cfg (any( |
82 | target_os = "android" , |
83 | target_os = "dragonfly" , |
84 | target_os = "freebsd" , |
85 | target_os = "linux" , |
86 | target_os = "macos" , |
87 | target_os = "netbsd" , |
88 | target_os = "openbsd" |
89 | ))] |
90 | feature! { |
91 | #![feature = "ptrace" ] |
92 | #[allow (missing_docs)] |
93 | pub mod ptrace; |
94 | } |
95 | |
96 | #[cfg (target_os = "linux" )] |
97 | feature! { |
98 | #![feature = "quota" ] |
99 | pub mod quota; |
100 | } |
101 | |
102 | #[cfg (target_os = "linux" )] |
103 | feature! { |
104 | #![feature = "reboot" ] |
105 | pub mod reboot; |
106 | } |
107 | |
108 | #[cfg (not(any( |
109 | target_os = "redox" , |
110 | target_os = "fuchsia" , |
111 | target_os = "illumos" , |
112 | target_os = "haiku" |
113 | )))] |
114 | feature! { |
115 | #![feature = "resource" ] |
116 | pub mod resource; |
117 | } |
118 | |
119 | feature! { |
120 | #![feature = "poll" ] |
121 | pub mod select; |
122 | } |
123 | |
124 | #[cfg (any( |
125 | target_os = "android" , |
126 | target_os = "dragonfly" , |
127 | target_os = "freebsd" , |
128 | target_os = "ios" , |
129 | target_os = "linux" , |
130 | target_os = "macos" |
131 | ))] |
132 | feature! { |
133 | #![feature = "zerocopy" ] |
134 | pub mod sendfile; |
135 | } |
136 | |
137 | pub mod signal; |
138 | |
139 | #[cfg (any(target_os = "android" , target_os = "linux" ))] |
140 | feature! { |
141 | #![feature = "signal" ] |
142 | #[allow (missing_docs)] |
143 | pub mod signalfd; |
144 | } |
145 | |
146 | feature! { |
147 | #![feature = "socket" ] |
148 | #[allow (missing_docs)] |
149 | pub mod socket; |
150 | } |
151 | |
152 | feature! { |
153 | #![feature = "fs" ] |
154 | #[allow (missing_docs)] |
155 | pub mod stat; |
156 | } |
157 | |
158 | #[cfg (any( |
159 | target_os = "android" , |
160 | target_os = "dragonfly" , |
161 | target_os = "freebsd" , |
162 | target_os = "ios" , |
163 | target_os = "linux" , |
164 | target_os = "macos" , |
165 | target_os = "openbsd" |
166 | ))] |
167 | feature! { |
168 | #![feature = "fs" ] |
169 | pub mod statfs; |
170 | } |
171 | |
172 | feature! { |
173 | #![feature = "fs" ] |
174 | pub mod statvfs; |
175 | } |
176 | |
177 | #[cfg (any(target_os = "android" , target_os = "linux" ))] |
178 | #[cfg_attr (docsrs, doc(cfg(all())))] |
179 | #[allow (missing_docs)] |
180 | pub mod sysinfo; |
181 | |
182 | feature! { |
183 | #![feature = "term" ] |
184 | #[allow (missing_docs)] |
185 | pub mod termios; |
186 | } |
187 | |
188 | #[allow (missing_docs)] |
189 | pub mod time; |
190 | |
191 | feature! { |
192 | #![feature = "uio" ] |
193 | pub mod uio; |
194 | } |
195 | |
196 | feature! { |
197 | #![feature = "feature" ] |
198 | pub mod utsname; |
199 | } |
200 | |
201 | feature! { |
202 | #![feature = "process" ] |
203 | pub mod wait; |
204 | } |
205 | |
206 | #[cfg (any(target_os = "android" , target_os = "linux" ))] |
207 | feature! { |
208 | #![feature = "inotify" ] |
209 | pub mod inotify; |
210 | } |
211 | |
212 | #[cfg (any(target_os = "android" , target_os = "linux" ))] |
213 | feature! { |
214 | #![feature = "time" ] |
215 | pub mod timerfd; |
216 | } |
217 | |
218 | #[cfg (all( |
219 | any( |
220 | target_os = "freebsd" , |
221 | target_os = "illumos" , |
222 | target_os = "linux" , |
223 | target_os = "netbsd" |
224 | ), |
225 | feature = "time" , |
226 | feature = "signal" |
227 | ))] |
228 | feature! { |
229 | #![feature = "time" ] |
230 | pub mod timer; |
231 | } |
232 | |