kernel: Include waited-for grandchildren in RUSAGE_CHILDREN's times
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
apio 2023-07-25 17:50:15 +02:00
parent b88da4811f
commit 28dd8194af
Signed by: apio
GPG Key ID: B8A7D06E42258954

View File

@ -61,7 +61,7 @@ Result<u64> sys_waitpid(Registers* regs, SyscallArgs args)
else
thread = child.value();
}
else
else // FIXME: Now that we have process groups, implement the cases where pid = 0 and pid < -1.
return err(ENOTSUP);
current->child_being_waited_for = {};
@ -69,8 +69,8 @@ Result<u64> sys_waitpid(Registers* regs, SyscallArgs args)
int status = (int)thread->status;
u64 id = thread->id;
current->user_ticks_children += thread->user_ticks_self;
current->kernel_ticks_children += thread->kernel_ticks_self;
current->user_ticks_children += thread->user_ticks_self + thread->user_ticks_children;
current->kernel_ticks_children += thread->kernel_ticks_self + thread->kernel_ticks_children;
thread->state = ThreadState::Dying;
Scheduler::signal_reap_thread();