UserspaceEmulator: Default-initialize the siginfo struct used in waitid

Otherwise it'll have some random value from the stack, and the kernel
will not bother setting it to zero.
Also add a debug print and tweak the FIXME message.
This commit is contained in:
AnotherTest 2021-03-30 10:20:54 +04:30 committed by Andreas Kling
parent c4cf4ef111
commit cbd62c472e
Notes: sideshowbarker 2024-07-18 20:55:49 +09:00

View file

@ -1358,7 +1358,7 @@ int Emulator::virt$waitid(FlatPtr params_addr)
mmu().copy_from_vm(&params, params_addr, sizeof(params));
Syscall::SC_waitid_params host_params = params;
siginfo info;
siginfo info {};
host_params.infop = &info;
int rc = syscall(SC_waitid, &host_params);
@ -1366,7 +1366,8 @@ int Emulator::virt$waitid(FlatPtr params_addr)
return rc;
if (info.si_addr) {
// FIXME: Translate this somehow.
// FIXME: Translate this somehow once we actually start setting it in the kernel.
dbgln("si_addr is set to {:p}, I did not expect this!", info.si_addr);
TODO();
}