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