Skip to content

Commit

Permalink
Remove sigevent support on Fuchsia
Browse files Browse the repository at this point in the history
It triggers UB, which the compiler warns about beginning with 1.41.0.
Remove it, due to lack of a Fuchsia maintainer and lack of feedback from
the original Fuchsia porter.

Fixes #1441
  • Loading branch information
asomers committed Jul 17, 2023
1 parent c375a10 commit 192d503
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,8 @@ This project adheres to [Semantic Versioning](https://semver.org/).
- `nix::sys::signalfd::signalfd` is deprecated. Use
`nix::sys::signalfd::SignalFd` instead.
([#1938](https://github.com/nix-rust/nix/pull/1938))
- Removed `SigEvent` support on Fuchsia, where it was unsound.
([#2079](https://github.com/nix-rust/nix/pull/2079))

## [0.26.2] - 2023-01-18

Expand Down
7 changes: 2 additions & 5 deletions src/sys/signal.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ use std::os::unix::io::RawFd;
use std::ptr;
use std::str::FromStr;

#[cfg(not(any(target_os = "openbsd", target_os = "redox")))]
#[cfg(not(any(target_os = "fuchsia", target_os = "openbsd", target_os = "redox")))]
#[cfg(any(feature = "aio", feature = "signal"))]
pub use self::sigevent::*;

Expand Down Expand Up @@ -1018,7 +1018,7 @@ pub enum SigevNotify {
}
}

#[cfg(not(any(target_os = "openbsd", target_os = "redox")))]
#[cfg(not(any(target_os = "fuchsia", target_os = "openbsd", target_os = "redox")))]
#[cfg_attr(docsrs, doc(cfg(all())))]
mod sigevent {
feature! {
Expand Down Expand Up @@ -1052,9 +1052,6 @@ mod sigevent {
/// Linux, Solaris, and portable programs should prefer `SIGEV_THREAD_ID` or
/// `SIGEV_SIGNAL`. That field is part of a union that shares space with the
/// more genuinely useful `sigev_notify_thread_id`
// Allow invalid_value warning on Fuchsia only.
// See https://github.com/nix-rust/nix/issues/1441
#[cfg_attr(target_os = "fuchsia", allow(invalid_value))]
pub fn new(sigev_notify: SigevNotify) -> SigEvent {
let mut sev = unsafe { mem::MaybeUninit::<libc::sigevent>::zeroed().assume_init() };
sev.sigev_notify = match sigev_notify {
Expand Down

0 comments on commit 192d503

Please sign in to comment.