Skip to content

Commit

Permalink
add poll module for all platforms
Browse files Browse the repository at this point in the history
  • Loading branch information
ndusart committed Jul 13, 2017
1 parent 17f87d4 commit 85f1e2e
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 7 deletions.
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ preadv_pwritev = []
signalfd = []

[dependencies]
libc = "0.2.25"
libc = { git = "https://github.com/rust-lang/libc" }
bitflags = "0.9"
cfg-if = "0.1.0"
void = "1.0.2"
Expand Down
3 changes: 1 addition & 2 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,6 @@ pub mod mqueue;

pub mod pty;

#[cfg(any(target_os = "linux", target_os = "macos"))]
pub mod poll;

pub mod net;
Expand Down Expand Up @@ -96,7 +95,7 @@ pub enum Error {
/// The operation involved a conversion to Rust's native String type, which failed because the
/// string did not contain all valid UTF-8.
InvalidUtf8,
/// The operation is not supported by Nix, in this instance either use the libc bindings or
/// The operation is not supported by Nix, in this instance either use the libc bindings or
/// consult the module documentation to see if there is a more appropriate interface available.
UnsupportedOperation,
}
Expand Down
6 changes: 3 additions & 3 deletions src/poll.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#[cfg(any(target_os = "linux", target_os = "android"))]
#[cfg(any(target_os = "linux", target_os = "android", target_os = "freebsd", target_os = "dragonfly"))]
use sys::time::TimeSpec;
#[cfg(any(target_os = "linux", target_os = "android"))]
#[cfg(any(target_os = "linux", target_os = "android", target_os = "freebsd", target_os = "dragonfly"))]
use sys::signal::SigSet;

use libc;
Expand Down Expand Up @@ -53,7 +53,7 @@ pub fn poll(fds: &mut [PollFd], timeout: libc::c_int) -> Result<libc::c_int> {
Errno::result(res)
}

#[cfg(any(target_os = "linux", target_os = "android"))]
#[cfg(any(target_os = "linux", target_os = "android", target_os = "freebsd", target_os = "dragonfly"))]
pub fn ppoll(fds: &mut [PollFd], timeout: TimeSpec, sigmask: SigSet) -> Result<libc::c_int> {


Expand Down
1 change: 0 additions & 1 deletion test/test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ mod test_fcntl;
mod test_mq;
mod test_net;
mod test_nix_path;
#[cfg(any(target_os = "linux", target_os = "macos"))]
mod test_poll;
mod test_pty;
#[cfg(any(target_os = "linux", target_os = "android"))]
Expand Down

0 comments on commit 85f1e2e

Please sign in to comment.