mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 01:27:42 +00:00
Kernel: Add helper function to check if a Process is in jail
Use this helper function in various places to replace the old code of acquiring the SpinlockProtected<RefPtr<Jail>> of a Process to do that validation.
This commit is contained in:
parent
6b3688147f
commit
d8ebcaede8
4 changed files with 15 additions and 18 deletions
|
@ -240,6 +240,11 @@ public:
|
|||
|
||||
SpinlockProtected<RefPtr<Jail>, LockRank::Process>& jail() { return m_attached_jail; }
|
||||
|
||||
bool is_currently_in_jail() const
|
||||
{
|
||||
return m_attached_jail.with([&](auto& jail) -> bool { return !jail.is_null(); });
|
||||
}
|
||||
|
||||
NonnullRefPtr<Credentials> credentials() const;
|
||||
|
||||
bool is_dumpable() const
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue