From cddf85a57adc8ced1693c7f0c5f45bfc028ec2b2 Mon Sep 17 00:00:00 2001 From: David Carlier Date: Tue, 6 Jul 2021 18:38:31 +0100 Subject: [PATCH] netbsd siginfo_t si_status accessor closes #2265 --- src/unix/bsd/netbsdlike/netbsd/mod.rs | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/src/unix/bsd/netbsdlike/netbsd/mod.rs b/src/unix/bsd/netbsdlike/netbsd/mod.rs index d093bb6a4893a..d998f57ec924c 100644 --- a/src/unix/bsd/netbsdlike/netbsd/mod.rs +++ b/src/unix/bsd/netbsdlike/netbsd/mod.rs @@ -64,6 +64,23 @@ impl siginfo_t { } (*(self as *const siginfo_t as *const siginfo_timer)).value } + + pub unsafe fn si_status(&self) -> ::c_int { + #[repr(C)] + struct siginfo_timer { + _si_signo: ::c_int, + _si_errno: ::c_int, + _si_code: ::c_int, + __pad1: ::c_int, + _pid: ::pid_t, + _uid: ::uid_t, + _value: ::sigval, + _cpid: ::pid_t, + _cuid: ::uid_t, + status: ::c_int, + } + (*(self as *const siginfo_t as *const siginfo_timer)).status + } } s! {