1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-06-30 05:42:06 +00:00

Kernel: Move ProcFS related overrides in Process to ProcessProcFSTraits

This allows us to 1) let go of the Process when an inode is ref'ing for
ProcFSExposedComponent related reasons, and 2) change our ref/unref
implementation.
This commit is contained in:
sin-ack 2021-08-14 12:43:34 +00:00 committed by Andreas Kling
parent 748938ea59
commit 2830a0ecda
7 changed files with 143 additions and 61 deletions

View file

@ -260,6 +260,11 @@ Process::Process(const String& name, uid_t uid, gid_t gid, ProcessID ppid, bool
m_protected_values.suid = uid;
m_protected_values.sgid = gid;
auto maybe_procfs_traits = ProcessProcFSTraits::try_create({}, make_weak_ptr());
// NOTE: This can fail, but it should be very, *very* rare.
VERIFY(!maybe_procfs_traits.is_error());
m_procfs_traits = maybe_procfs_traits.release_value();
dbgln_if(PROCESS_DEBUG, "Created new process {}({})", m_name, this->pid().value());
}