On Linux and Mac OS,
siginfo_t contains a field
si_addr to show which memory address caused this signal.
However for Rust’s
libc crate, on Mac OS,
siginfo_t contains a field of
si_addr as expected (https://doc.rust-lang.org/libc/x86_64-apple-darwin/libc/struct.siginfo_t.html). But on linux,
siginfo_t has no explicit
si_addr field - it falls in one of the padding fields (https://doc.rust-lang.org/libc/x86_64-unknown-linux-gnu/libc/struct.siginfo_t.html).
I don’t quite understand the reason behind this. And I am wondering how I should access
si_addr field on Linux (though I can access from some specific indices of the
_pad field or create my own wrapper of
siginfo_t for Linux, but this seems far away from a good solution).