Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ jobs:
#- i686-unknown-hurd-gnu
# TODO: reenable <https://github.com/tokio-rs/mio/issues/1882>.
#- powerpc64-ibm-aix
- riscv32imc-esp-espidf
#- riscv32imc-esp-espidf
- sparcv9-sun-solaris
- wasm32-wasip1
- x86_64-apple-darwin
Expand All @@ -171,7 +171,7 @@ jobs:
- x86_64-unknown-dragonfly
- x86_64-unknown-freebsd
- x86_64-unknown-fuchsia
- x86_64-unknown-haiku
#- x86_64-unknown-haiku
- x86_64-unknown-hermit
- x86_64-unknown-illumos
- x86_64-unknown-linux-gnu
Expand Down
2 changes: 1 addition & 1 deletion src/sys/shell/selector.rs
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ cfg_os_ext! {
}

#[cfg(target_os = "wasi")]
cfg_os_ext! {
cfg_any_os_ext! {
use crate::{Interest, Token};

impl Selector {
Expand Down
2 changes: 1 addition & 1 deletion src/sys/unix/selector/epoll.rs
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ impl Selector {
syscall!(epoll_ctl(ep, libc::EPOLL_CTL_ADD, fd, &mut event)).map(|_| ())
}

cfg_io_source! {
cfg_any_os_ext! {
pub fn reregister(&self, fd: RawFd, token: Token, interests: Interest) -> io::Result<()> {
let mut event = libc::epoll_event {
events: interests_to_epoll(interests),
Expand Down
15 changes: 5 additions & 10 deletions src/sys/unix/selector/kqueue.rs
Original file line number Diff line number Diff line change
@@ -1,20 +1,16 @@
use std::mem;
use std::mem::MaybeUninit;
use std::ops::{Deref, DerefMut};
use std::os::fd::{AsRawFd, FromRawFd, OwnedFd, RawFd};
use std::slice;
#[cfg(debug_assertions)]
use std::sync::atomic::{AtomicUsize, Ordering};
use std::time::Duration;
use std::{cmp, io, ptr};

use crate::Interest;
use crate::Token;

cfg_io_source! {
use std::mem::MaybeUninit;
use std::slice;

use crate::Interest;
}

/// Unique id for use as `SelectorId`.
#[cfg(debug_assertions)]
static NEXT_ID: AtomicUsize = AtomicUsize::new(1);
Expand Down Expand Up @@ -129,7 +125,7 @@ impl Selector {
})
}

cfg_io_source! {
#[cfg_attr(not(feature = "os-ext"), allow(dead_code))]
pub fn register(&self, fd: RawFd, token: Token, interests: Interest) -> io::Result<()> {
let flags = libc::EV_CLEAR | libc::EV_RECEIPT | libc::EV_ADD;
// At most we need two changes, but maybe we only need 1.
Expand Down Expand Up @@ -169,6 +165,7 @@ impl Selector {
kevent_register(self.kq.as_raw_fd(), changes, &[libc::EPIPE as i64])
}

cfg_any_os_ext! {
pub fn reregister(&self, fd: RawFd, token: Token, interests: Interest) -> io::Result<()> {
let flags = libc::EV_CLEAR | libc::EV_RECEIPT;
let write_flags = if interests.is_writable() {
Expand Down Expand Up @@ -275,7 +272,6 @@ impl Selector {
}
}

cfg_io_source! {
/// Register `changes` with `kq`ueue.
fn kevent_register(
kq: RawFd,
Expand Down Expand Up @@ -318,7 +314,6 @@ fn check_errors(events: &[libc::kevent], ignored_errors: &[i64]) -> io::Result<(
}
Ok(())
}
}

cfg_io_source! {
#[cfg(debug_assertions)]
Expand Down
4 changes: 2 additions & 2 deletions src/sys/unix/selector/poll.rs
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ impl Selector {
self.state.register_internal(fd, token, interests)
}

cfg_io_source! {
cfg_any_os_ext! {
pub fn reregister(&self, fd: RawFd, token: Token, interests: Interest) -> io::Result<()> {
self.state.reregister(fd, token, interests)
}
Expand Down Expand Up @@ -356,7 +356,7 @@ impl SelectorState {
})
}

cfg_io_source! {
cfg_any_os_ext! {
pub fn reregister(&self, fd: RawFd, token: Token, interests: Interest) -> io::Result<()> {
self.modify_fds(|fds| {
let data = fds.fd_data.get_mut(&fd).ok_or(io::ErrorKind::NotFound)?;
Expand Down
Loading