From 53af2444e6b5ace35bbf3df80ad3de7a8c0b1c04 Mon Sep 17 00:00:00 2001 From: Patrick Mooney Date: Tue, 14 Apr 2020 03:23:16 +0000 Subject: [PATCH] Add support for illumos target --- src/sys/unix/mod.rs | 6 ++++-- src/sys/unix/ready.rs | 15 +++++++++------ 2 files changed, 13 insertions(+), 8 deletions(-) diff --git a/src/sys/unix/mod.rs b/src/sys/unix/mod.rs index 5bb83070d2..4613ad82c8 100644 --- a/src/sys/unix/mod.rs +++ b/src/sys/unix/mod.rs @@ -3,10 +3,12 @@ use libc::{self, c_int}; #[macro_use] pub mod dlsym; -#[cfg(any(target_os = "linux", target_os = "android", target_os = "solaris"))] +#[cfg(any(target_os = "linux", target_os = "android", target_os = "solaris", + target_os = "illumos"))] mod epoll; -#[cfg(any(target_os = "linux", target_os = "android", target_os = "solaris"))] +#[cfg(any(target_os = "linux", target_os = "android", target_os = "solaris", + target_os = "illumos"))] pub use self::epoll::{Events, Selector}; #[cfg(any(target_os = "bitrig", target_os = "dragonfly", diff --git a/src/sys/unix/ready.rs b/src/sys/unix/ready.rs index 1780ceae9f..09bc6331f8 100644 --- a/src/sys/unix/ready.rs +++ b/src/sys/unix/ready.rs @@ -109,10 +109,12 @@ const LIO: usize = 0b10_0000; #[cfg(not(any(target_os = "freebsd")))] const LIO: usize = 0b00_0000; -#[cfg(any(target_os = "linux", target_os = "android", target_os = "solaris"))] +#[cfg(any(target_os = "linux", target_os = "android", target_os = "solaris", + target_os = "illumos"))] const PRI: usize = 0b100_0000; -#[cfg(not(any(target_os = "linux", target_os = "android", target_os = "solaris")))] +#[cfg(not(any(target_os = "linux", target_os = "android", target_os = "solaris", + target_os = "illumos")))] const PRI: usize = 0; // Export to support `Ready::all` @@ -129,7 +131,8 @@ fn test_ready_all() { ); // Issue #896. - #[cfg(any(target_os = "linux", target_os = "android", target_os = "solaris"))] + #[cfg(any(target_os = "linux", target_os = "android", target_os = "solaris", + target_os = "illumos"))] assert!(!Ready::from(UnixReady::priority()).is_writable()); } @@ -259,7 +262,7 @@ impl UnixReady { /// [`Poll`]: struct.Poll.html #[inline] #[cfg(any(target_os = "linux", - target_os = "android", target_os = "solaris"))] + target_os = "android", target_os = "solaris", target_os = "illumos"))] pub fn priority() -> UnixReady { UnixReady(ready_from_usize(PRI)) } @@ -386,7 +389,7 @@ impl UnixReady { /// [`Poll`]: struct.Poll.html #[inline] #[cfg(any(target_os = "linux", - target_os = "android", target_os = "solaris"))] + target_os = "android", target_os = "solaris", target_os = "illumos"))] pub fn is_priority(&self) -> bool { self.contains(ready_from_usize(PRI)) } @@ -477,7 +480,7 @@ impl fmt::Debug for UnixReady { #[allow(deprecated)] (UnixReady::aio(), "Aio"), #[cfg(any(target_os = "linux", - target_os = "android", target_os = "solaris"))] + target_os = "android", target_os = "solaris", target_os = "illumos"))] (UnixReady::priority(), "Priority"), ];