Skip to content

Commit

Permalink
Disable epoll support on Solaris.
Browse files Browse the repository at this point in the history
It appears Solaris doesn't support epoll; only Illumos does. And as
of rust-lang/libc#3864, the libc crate won't declare the epoll libc
interface on Solaris. So disable epoll support on Solaris in rustix
too.
  • Loading branch information
sunfishcode committed Nov 5, 2024
1 parent 2150a82 commit bbbea8b
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 10 deletions.
2 changes: 1 addition & 1 deletion src/backend/libc/conv.rs
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ pub(super) fn ret_c_int(raw: c::c_int) -> io::Result<c::c_int> {

#[cfg(any(
linux_kernel,
all(solarish, feature = "event"),
all(target_os = "illumos", feature = "event"),
all(target_os = "redox", feature = "event")
))]
#[inline]
Expand Down
2 changes: 1 addition & 1 deletion src/backend/libc/event/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,5 @@ pub(crate) mod types;
#[cfg_attr(windows, path = "windows_syscalls.rs")]
pub(crate) mod syscalls;

#[cfg(any(linux_kernel, solarish, target_os = "redox"))]
#[cfg(any(linux_kernel, target_os = "illumos", target_os = "redox"))]
pub mod epoll;
14 changes: 7 additions & 7 deletions src/backend/libc/event/syscalls.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ use crate::backend::c;
use crate::backend::conv::ret;
use crate::backend::conv::ret_c_int;
#[cfg(feature = "alloc")]
#[cfg(any(linux_kernel, solarish, target_os = "redox"))]
#[cfg(any(linux_kernel, target_os = "illumos", target_os = "redox"))]
use crate::backend::conv::ret_u32;
#[cfg(solarish)]
use crate::event::port::Event;
Expand All @@ -22,7 +22,7 @@ use crate::event::PollFd;
use crate::io;
#[cfg(solarish)]
use crate::utils::as_mut_ptr;
#[cfg(any(linux_kernel, solarish, target_os = "redox"))]
#[cfg(any(linux_kernel, target_os = "illumos", target_os = "redox"))]
use crate::utils::as_ptr;
#[cfg(any(
all(feature = "alloc", bsd),
Expand Down Expand Up @@ -351,13 +351,13 @@ pub(crate) fn pause() {
}

#[inline]
#[cfg(any(linux_kernel, solarish, target_os = "redox"))]
#[cfg(any(linux_kernel, target_os = "illumos", target_os = "redox"))]
pub(crate) fn epoll_create(flags: super::epoll::CreateFlags) -> io::Result<OwnedFd> {
unsafe { ret_owned_fd(c::epoll_create1(bitflags_bits!(flags))) }
}

#[inline]
#[cfg(any(linux_kernel, solarish, target_os = "redox"))]
#[cfg(any(linux_kernel, target_os = "illumos", target_os = "redox"))]
pub(crate) fn epoll_add(
epoll: BorrowedFd<'_>,
source: BorrowedFd<'_>,
Expand All @@ -378,7 +378,7 @@ pub(crate) fn epoll_add(
}

#[inline]
#[cfg(any(linux_kernel, solarish, target_os = "redox"))]
#[cfg(any(linux_kernel, target_os = "illumos", target_os = "redox"))]
pub(crate) fn epoll_mod(
epoll: BorrowedFd<'_>,
source: BorrowedFd<'_>,
Expand All @@ -396,7 +396,7 @@ pub(crate) fn epoll_mod(
}

#[inline]
#[cfg(any(linux_kernel, solarish, target_os = "redox"))]
#[cfg(any(linux_kernel, target_os = "illumos", target_os = "redox"))]
pub(crate) fn epoll_del(epoll: BorrowedFd<'_>, source: BorrowedFd<'_>) -> io::Result<()> {
unsafe {
ret(c::epoll_ctl(
Expand All @@ -410,7 +410,7 @@ pub(crate) fn epoll_del(epoll: BorrowedFd<'_>, source: BorrowedFd<'_>) -> io::Re

#[inline]
#[cfg(feature = "alloc")]
#[cfg(any(linux_kernel, solarish, target_os = "redox"))]
#[cfg(any(linux_kernel, target_os = "illumos", target_os = "redox"))]
pub(crate) fn epoll_wait(
epoll: BorrowedFd<'_>,
events: &mut [MaybeUninit<crate::event::epoll::Event>],
Expand Down
2 changes: 1 addition & 1 deletion src/event/mod.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
//! Event operations.

#[cfg(any(linux_kernel, solarish, target_os = "redox"))]
#[cfg(any(linux_kernel, target_os = "illumos", target_os = "redox"))]
pub mod epoll;
#[cfg(any(
linux_kernel,
Expand Down

0 comments on commit bbbea8b

Please sign in to comment.