Support PR_SET/GET_CHILD_SUBREAPER for sys_prctl

This commit is contained in:
Chen Chengjun
2025-03-03 17:02:08 +08:00
committed by Tate, Hongliang Tian
parent 0903457be3
commit 801eac9386
4 changed files with 147 additions and 10 deletions

View File

@ -375,6 +375,13 @@ fn clone_child_process(
// Sets parent process and group for child process.
set_parent_and_group(process, &child);
// Updates `has_child_subreaper` for the child process after inserting
// it to its parent's children to make sure the `has_child_subreaper`
// state of the child process will be consistent with its parent.
if process.has_child_subreaper.load(Ordering::Relaxed) {
child.has_child_subreaper.store(true, Ordering::Relaxed);
}
Ok(child)
}