From 0ce0274a9a8b8937afb5ae278b5202ba97ce0cb6 Mon Sep 17 00:00:00 2001 From: dybucc <149513579+dybucc@users.noreply.github.com> Date: Tue, 23 Jun 2026 18:07:12 +0200 Subject: [PATCH] fuchsia: fix `sigaction` definition Proposes a solution to fix `sigaction` [1]. This contributes to the open question on how to manage this type. [1]: https://cs.opensource.google/fuchsia/fuchsia/+/main:zircon/third_party/ulib/musl/include/signal.h;l=197-205 --- src/fuchsia/mod.rs | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/src/fuchsia/mod.rs b/src/fuchsia/mod.rs index 834d4e9fac2b7..95dc8383e07fe 100644 --- a/src/fuchsia/mod.rs +++ b/src/fuchsia/mod.rs @@ -267,15 +267,6 @@ s! { __dummy4: [c_char; 16], } - // FIXME(1.0): This should not implement `PartialEq` - #[allow(unpredictable_function_pointer_comparisons)] - pub struct sigaction { - pub sa_sigaction: crate::sighandler_t, - pub sa_mask: crate::sigset_t, - pub sa_flags: c_int, - pub sa_restorer: Option, - } - pub struct termios { pub c_iflag: crate::tcflag_t, pub c_oflag: crate::tcflag_t, @@ -1037,6 +1028,18 @@ s_no_extra_traits! { ifu_broadaddr: *mut sockaddr, ifu_dstaddr: *mut sockaddr, } + + pub union __c_anonymous_sigaction___sa_handler { + sa_handler: Option, + sa_sigaction: Option, + } + + pub struct sigaction { + pub __sa_handler: crate::__c_anonymous_sigaction___sa_handler, + pub sa_mask: crate::sigset_t, + pub sa_flags: c_int, + pub sa_restorer: Option, + } } cfg_if! {