[libc] Update siginfo_t to match kernel definition (#66560)
This patch updates the siginfo_t struct definition to match the definition from the kernel here: https://github.com/torvalds/linux/blob/master/include/uapi/asm-generic/siginfo.h In particular, there are two main changes: 1. swap position of si_code and si_errno: si_code show come after si_errno in all systems except MIPS. Since we don't MIPS, the order is fixed for now, but can be easily \#ifdef'd if MIPS support is implemented in the future. 2. We add a union of structs that are filled depending on the signal raised. This change was required for the fork and spawn integration tests in rv32, since they fork/clone the running process, call wait/waitid/waitpid, and read the status, which was wrong in rv32 because wait/waitid/waitpid are implemented in rv32 using SYS_waitid. SYS_waitid takes a pointer to a siginfo_t and fills the proper fields in the struct. The previous siginfo_t definition was being incorrectly filled due to not taking into account the signal raised.
Loading
Please sign in to comment