linux-user/signal: Decode waitid si_code
commit1c3dfb506ea3decd17ec69ed6eaf611a885b9f59
authorAlistair Francis <alistair.francis@wdc.com>
Tue, 19 Jan 2021 18:24:52 +0000 (19 10:24 -0800)
committerLaurent Vivier <laurent@vivier.eu>
Sat, 13 Feb 2021 21:50:49 +0000 (13 22:50 +0100)
treeaae2504ce4259d1c86f92151fa4c41dfbe3c5bf4
parent0b72da03001c8c9f077fc019b9651c19a32c4600
linux-user/signal: Decode waitid si_code

When mapping the host waitid status to the target status we previously
just used decoding information in the status value. This doesn't follow
what the waitid documentation describes, which instead suggests using
the si_code value for the decoding. This results in the incorrect values
seen when calling waitid. This is especially apparent on RV32 where all
wait calls use waitid (see the bug case).

This patch just passes the waitid status directly back to the guest.

Buglink: https://bugs.launchpad.net/qemu/+bug/1906193
Signed-off-by: Alistair Francis <alistair.francis@wdc.com>
Tested-by: Andreas K. Hüttel <dilfridge@gentoo.org>
Reviewed-by: Laurent Vivier <laurent@vivier.eu>
Message-Id: <1fb2d56aa23a81f4473e638abe9e2d78c09a3d5b.1611080607.git.alistair.francis@wdc.com>
Signed-off-by: Laurent Vivier <laurent@vivier.eu>
linux-user/signal.c