1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-19 00:45:08 +00:00

Kernel: Add /proc/{pid}/children to ProcFS

This exposes the child processes for a process as a directory
of symlinks to the respective /proc entries for each child.

This makes for an easier and possibly more efficient way
to find and count a process's children. Previously the only
method was to parse the entire /proc/all JSON file.
This commit is contained in:
MacDue 2022-05-04 16:22:18 +01:00 committed by Ali Mohammad Pur
parent 222079cd80
commit d951e2ca97
7 changed files with 73 additions and 0 deletions

View file

@ -67,6 +67,11 @@ InodeIndex build_segmented_index_for_file_description(ProcessID pid, unsigned fd
return build_segmented_index_with_unknown_property(pid, ProcessSubDirectory::OpenFileDescriptions, fd);
}
InodeIndex build_segmented_index_for_children(ProcessID pid, ProcessID child_pid)
{
return build_segmented_index_with_unknown_property(pid, ProcessSubDirectory::Children, child_pid.value());
}
}
static size_t s_allocate_global_inode_index()