nix/sys/
mod.rs

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