mirror of
https://github.com/RGBCube/serenity
synced 2025-07-10 08:57:35 +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:
parent
222079cd80
commit
d951e2ca97
7 changed files with 73 additions and 0 deletions
|
@ -172,11 +172,14 @@ public:
|
|||
static ErrorOr<NonnullRefPtr<ProcFSProcessPropertyInode>> try_create_for_file_description_link(ProcFS const&, unsigned, ProcessID);
|
||||
static ErrorOr<NonnullRefPtr<ProcFSProcessPropertyInode>> try_create_for_thread_stack(ProcFS const&, ThreadID, ProcessID);
|
||||
static ErrorOr<NonnullRefPtr<ProcFSProcessPropertyInode>> try_create_for_pid_property(ProcFS const&, SegmentedProcFSIndex::MainProcessProperty, ProcessID);
|
||||
static ErrorOr<NonnullRefPtr<ProcFSProcessPropertyInode>> try_create_for_child_process_link(ProcFS const&, ProcessID, ProcessID);
|
||||
|
||||
private:
|
||||
ProcFSProcessPropertyInode(ProcFS const&, SegmentedProcFSIndex::MainProcessProperty, ProcessID);
|
||||
ProcFSProcessPropertyInode(ProcFS const&, ThreadID, ProcessID);
|
||||
ProcFSProcessPropertyInode(ProcFS const&, unsigned, ProcessID);
|
||||
ProcFSProcessPropertyInode(ProcFS const&, ProcessID, ProcessID);
|
||||
|
||||
// ^Inode
|
||||
virtual ErrorOr<void> attach(OpenFileDescription& description) override;
|
||||
virtual void did_seek(OpenFileDescription&, off_t) override;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue