Skip to content

Commit

Permalink
Add support for illumos target
Browse files Browse the repository at this point in the history
  • Loading branch information
pfmooney committed Apr 14, 2020
1 parent cd0423c commit 53af244
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 8 deletions.
6 changes: 4 additions & 2 deletions src/sys/unix/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
15 changes: 9 additions & 6 deletions src/sys/unix/ready.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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`
Expand 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());
}

Expand Down Expand Up @@ -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))
}
Expand Down Expand Up @@ -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))
}
Expand Down Expand Up @@ -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"),
];

Expand Down

0 comments on commit 53af244

Please sign in to comment.