Skip to content

Commit 192d503

Browse files
committed
Remove sigevent support on Fuchsia
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
1 parent c375a10 commit 192d503

File tree

2 files changed

+4
-5
lines changed

2 files changed

+4
-5
lines changed

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,8 @@ This project adheres to [Semantic Versioning](https://semver.org/).
5858
- `nix::sys::signalfd::signalfd` is deprecated. Use
5959
`nix::sys::signalfd::SignalFd` instead.
6060
([#1938](https://github.com/nix-rust/nix/pull/1938))
61+
- Removed `SigEvent` support on Fuchsia, where it was unsound.
62+
([#2079](https://github.com/nix-rust/nix/pull/2079))
6163

6264
## [0.26.2] - 2023-01-18
6365

src/sys/signal.rs

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ use std::os::unix::io::RawFd;
1313
use std::ptr;
1414
use std::str::FromStr;
1515

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

@@ -1018,7 +1018,7 @@ pub enum SigevNotify {
10181018
}
10191019
}
10201020

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

0 commit comments

Comments
 (0)