diff --git a/Cargo.toml b/Cargo.toml index 1d4e100..1a74b6b 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -48,6 +48,3 @@ features = [ [dev-dependencies] easy-parallel = "3.1.0" fastrand = "2.0.0" - -[target.'cfg(any(unix, target_os = "fuchsia", target_os = "vxworks"))'.dev_dependencies] -libc = "0.2" diff --git a/examples/wait-signal.rs b/examples/wait-signal.rs index 4a645af..d4f5bc3 100644 --- a/examples/wait-signal.rs +++ b/examples/wait-signal.rs @@ -20,7 +20,7 @@ mod example { let poller = Poller::new().unwrap(); // Register SIGINT in the poller. - let sigint = Signal(libc::SIGINT); + let sigint = Signal(rustix::process::Signal::Int as _); poller.add_filter(sigint, 1, PollMode::Oneshot).unwrap(); let mut events = Events::new(); diff --git a/src/os/kqueue.rs b/src/os/kqueue.rs index 982640b..f670527 100644 --- a/src/os/kqueue.rs +++ b/src/os/kqueue.rs @@ -37,7 +37,7 @@ pub trait PollerKqueueExt: PollerSealed { /// let poller = Poller::new().unwrap(); /// /// // Register the SIGINT signal. - /// poller.add_filter(Signal(libc::SIGINT), 0, PollMode::Oneshot).unwrap(); + /// poller.add_filter(Signal(rustix::process::Signal::Int as _), 0, PollMode::Oneshot).unwrap(); /// /// // Wait for the signal. /// let mut events = Events::new(); @@ -60,10 +60,10 @@ pub trait PollerKqueueExt: PollerSealed { /// let poller = Poller::new().unwrap(); /// /// // Register the SIGINT signal. - /// poller.add_filter(Signal(libc::SIGINT), 0, PollMode::Oneshot).unwrap(); + /// poller.add_filter(Signal(rustix::process::Signal::Int as _), 0, PollMode::Oneshot).unwrap(); /// /// // Re-register with a different key. - /// poller.modify_filter(Signal(libc::SIGINT), 1, PollMode::Oneshot).unwrap(); + /// poller.modify_filter(Signal(rustix::process::Signal::Int as _), 1, PollMode::Oneshot).unwrap(); /// /// // Wait for the signal. /// let mut events = Events::new(); @@ -86,10 +86,10 @@ pub trait PollerKqueueExt: PollerSealed { /// let poller = Poller::new().unwrap(); /// /// // Register the SIGINT signal. - /// poller.add_filter(Signal(libc::SIGINT), 0, PollMode::Oneshot).unwrap(); + /// poller.add_filter(Signal(rustix::process::Signal::Int as _), 0, PollMode::Oneshot).unwrap(); /// /// // Remove the filter. - /// poller.delete_filter(Signal(libc::SIGINT)).unwrap(); + /// poller.delete_filter(Signal(rustix::process::Signal::Int as _)).unwrap(); /// ``` fn delete_filter(&self, filter: F) -> io::Result<()>; }