Skip to content

Commit 50d9fd2

Browse files
committed
Fix up siginfo_t for mips targets
1 parent 86b0b82 commit 50d9fd2

File tree

1 file changed

+5
-0
lines changed
  • src/unix/linux_like/linux/musl

1 file changed

+5
-0
lines changed

src/unix/linux_like/linux/musl/mod.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -146,10 +146,15 @@ s! {
146146
pub sa_restorer: ::Option<extern fn()>,
147147
}
148148

149+
// `mips*` targets swap the `s_errno` and `s_code` fields otherwise this struct is
150+
// target-agnostic (see https://www.openwall.com/lists/musl/2016/01/27/1/2)
149151
pub struct siginfo_t {
150152
pub si_signo: ::c_int,
153+
#[cfg(not(target_arch = "mips"))]
151154
pub si_errno: ::c_int,
152155
pub si_code: ::c_int,
156+
#[cfg(target_arch = "mips")]
157+
pub si_errno: ::c_int,
153158
#[doc(hidden)]
154159
#[deprecated(
155160
since="0.2.54",

0 commit comments

Comments
 (0)