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