Skip to content

Commit 5c985b7

Browse files
committed
Fix up siginfo_t for mips targets
1 parent ec384c7 commit 5c985b7

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

+5
Original file line numberDiff line numberDiff line change
@@ -150,10 +150,15 @@ s! {
150150
pub sa_restorer: ::Option<extern fn()>,
151151
}
152152

153+
// `mips*` targets swap the `s_errno` and `s_code` fields otherwise this struct is
154+
// target-agnostic (see https://www.openwall.com/lists/musl/2016/01/27/1/2)
153155
pub struct siginfo_t {
154156
pub si_signo: ::c_int,
157+
#[cfg(not(target_arch = "mips"))]
155158
pub si_errno: ::c_int,
156159
pub si_code: ::c_int,
160+
#[cfg(target_arch = "mips")]
161+
pub si_errno: ::c_int,
157162
#[doc(hidden)]
158163
#[deprecated(
159164
since="0.2.54",

0 commit comments

Comments
 (0)