summaryrefslogtreecommitdiffstats
path: root/third_party/rust/nix/src/sys/mod.rs
diff options
context:
space:
mode:
Diffstat (limited to 'third_party/rust/nix/src/sys/mod.rs')
-rw-r--r--third_party/rust/nix/src/sys/mod.rs82
1 files changed, 23 insertions, 59 deletions
diff --git a/third_party/rust/nix/src/sys/mod.rs b/third_party/rust/nix/src/sys/mod.rs
index bf047b3dda..93339d1935 100644
--- a/third_party/rust/nix/src/sys/mod.rs
+++ b/third_party/rust/nix/src/sys/mod.rs
@@ -1,10 +1,8 @@
//! Mostly platform-specific functionality
#[cfg(any(
- target_os = "dragonfly",
- target_os = "freebsd",
- target_os = "ios",
+ freebsdlike,
all(target_os = "linux", not(target_env = "uclibc")),
- target_os = "macos",
+ apple_targets,
target_os = "netbsd"
))]
feature! {
@@ -15,41 +13,31 @@ feature! {
feature! {
#![feature = "event"]
- #[cfg(any(target_os = "android", target_os = "linux"))]
+ #[cfg(linux_android)]
#[allow(missing_docs)]
pub mod epoll;
- #[cfg(any(target_os = "dragonfly",
- target_os = "freebsd",
- target_os = "ios",
- target_os = "macos",
- target_os = "netbsd",
- target_os = "openbsd"))]
+ #[cfg(bsd)]
pub mod event;
- #[cfg(any(target_os = "android", target_os = "linux"))]
+ #[cfg(any(linux_android, target_os = "freebsd"))]
#[allow(missing_docs)]
pub mod eventfd;
}
-#[cfg(any(
- target_os = "android",
- target_os = "dragonfly",
- target_os = "freebsd",
- target_os = "ios",
- target_os = "linux",
- target_os = "redox",
- target_os = "macos",
- target_os = "netbsd",
- target_os = "illumos",
- target_os = "openbsd"
-))]
+#[cfg(target_os = "linux")]
+feature! {
+ #![feature = "fanotify"]
+ pub mod fanotify;
+}
+
+#[cfg(any(bsd, linux_android, target_os = "redox", solarish))]
#[cfg(feature = "ioctl")]
#[cfg_attr(docsrs, doc(cfg(feature = "ioctl")))]
#[macro_use]
pub mod ioctl;
-#[cfg(any(target_os = "android", target_os = "freebsd", target_os = "linux"))]
+#[cfg(any(linux_android, target_os = "freebsd"))]
feature! {
#![feature = "fs"]
pub mod memfd;
@@ -78,15 +66,7 @@ feature! {
pub mod pthread;
}
-#[cfg(any(
- target_os = "android",
- target_os = "dragonfly",
- target_os = "freebsd",
- target_os = "linux",
- target_os = "macos",
- target_os = "netbsd",
- target_os = "openbsd"
-))]
+#[cfg(any(linux_android, bsd))]
feature! {
#![feature = "ptrace"]
#[allow(missing_docs)]
@@ -99,7 +79,7 @@ feature! {
pub mod quota;
}
-#[cfg(target_os = "linux")]
+#[cfg(any(target_os = "linux", netbsdlike))]
feature! {
#![feature = "reboot"]
pub mod reboot;
@@ -108,7 +88,7 @@ feature! {
#[cfg(not(any(
target_os = "redox",
target_os = "fuchsia",
- target_os = "illumos",
+ solarish,
target_os = "haiku"
)))]
feature! {
@@ -121,14 +101,7 @@ feature! {
pub mod select;
}
-#[cfg(any(
- target_os = "android",
- target_os = "dragonfly",
- target_os = "freebsd",
- target_os = "ios",
- target_os = "linux",
- target_os = "macos"
-))]
+#[cfg(any(linux_android, freebsdlike, apple_targets, solarish))]
feature! {
#![feature = "zerocopy"]
pub mod sendfile;
@@ -136,7 +109,7 @@ feature! {
pub mod signal;
-#[cfg(any(target_os = "android", target_os = "linux"))]
+#[cfg(linux_android)]
feature! {
#![feature = "signal"]
#[allow(missing_docs)]
@@ -155,15 +128,7 @@ feature! {
pub mod stat;
}
-#[cfg(any(
- target_os = "android",
- target_os = "dragonfly",
- target_os = "freebsd",
- target_os = "ios",
- target_os = "linux",
- target_os = "macos",
- target_os = "openbsd"
-))]
+#[cfg(any(linux_android, freebsdlike, apple_targets, target_os = "openbsd"))]
feature! {
#![feature = "fs"]
pub mod statfs;
@@ -174,8 +139,7 @@ feature! {
pub mod statvfs;
}
-#[cfg(any(target_os = "android", target_os = "linux"))]
-#[cfg_attr(docsrs, doc(cfg(all())))]
+#[cfg(linux_android)]
#[allow(missing_docs)]
pub mod sysinfo;
@@ -203,13 +167,13 @@ feature! {
pub mod wait;
}
-#[cfg(any(target_os = "android", target_os = "linux"))]
+#[cfg(linux_android)]
feature! {
#![feature = "inotify"]
pub mod inotify;
}
-#[cfg(any(target_os = "android", target_os = "linux"))]
+#[cfg(linux_android)]
feature! {
#![feature = "time"]
pub mod timerfd;
@@ -218,7 +182,7 @@ feature! {
#[cfg(all(
any(
target_os = "freebsd",
- target_os = "illumos",
+ solarish,
target_os = "linux",
target_os = "netbsd"
),