Skip to content

Commit d23b798

Browse files
bors[bot]asomers
andauthored
Merge #2079
2079: Remove sigevent support on Fuchsia r=asomers a=asomers 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 Co-authored-by: Alan Somers <[email protected]>
2 parents 5680df8 + 625287e commit d23b798

File tree

2 files changed

+13
-6
lines changed

2 files changed

+13
-6
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: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,11 @@ 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(
17+
target_os = "fuchsia",
18+
target_os = "openbsd",
19+
target_os = "redox"
20+
)))]
1721
#[cfg(any(feature = "aio", feature = "signal"))]
1822
pub use self::sigevent::*;
1923

@@ -979,7 +983,7 @@ pub type type_of_thread_id = libc::pid_t;
979983
// sigval is actually a union of a int and a void*. But it's never really used
980984
// as a pointer, because neither libc nor the kernel ever dereference it. nix
981985
// therefore presents it as an intptr_t, which is how kevent uses it.
982-
#[cfg(not(any(target_os = "openbsd", target_os = "redox")))]
986+
#[cfg(not(any(target_os = "fuchsia", target_os = "openbsd", target_os = "redox")))]
983987
#[derive(Clone, Copy, Debug, Eq, Hash, PartialEq)]
984988
pub enum SigevNotify {
985989
/// No notification will be delivered
@@ -1018,7 +1022,11 @@ pub enum SigevNotify {
10181022
}
10191023
}
10201024

1021-
#[cfg(not(any(target_os = "openbsd", target_os = "redox")))]
1025+
#[cfg(not(any(
1026+
target_os = "fuchsia",
1027+
target_os = "openbsd",
1028+
target_os = "redox"
1029+
)))]
10221030
#[cfg_attr(docsrs, doc(cfg(all())))]
10231031
mod sigevent {
10241032
feature! {
@@ -1052,9 +1060,6 @@ mod sigevent {
10521060
/// Linux, Solaris, and portable programs should prefer `SIGEV_THREAD_ID` or
10531061
/// `SIGEV_SIGNAL`. That field is part of a union that shares space with the
10541062
/// 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))]
10581063
pub fn new(sigev_notify: SigevNotify) -> SigEvent {
10591064
let mut sev = unsafe { mem::MaybeUninit::<libc::sigevent>::zeroed().assume_init() };
10601065
sev.sigev_notify = match sigev_notify {

0 commit comments

Comments
 (0)