1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 15:48:12 +00:00

Kernel: Make sys$getppid() not take the big lock

This only needs to access the process PPID, which is protected by the
"protected data" lock.
This commit is contained in:
Andreas Kling 2022-08-21 13:29:36 +02:00
parent 8ed06ad814
commit 18abba2c4d
2 changed files with 3 additions and 3 deletions

View file

@ -18,9 +18,9 @@ ErrorOr<FlatPtr> Process::sys$getpid()
ErrorOr<FlatPtr> Process::sys$getppid()
{
VERIFY_PROCESS_BIG_LOCK_ACQUIRED(this);
VERIFY_NO_PROCESS_BIG_LOCK(this);
TRY(require_promise(Pledge::stdio));
return with_protected_data([](auto& protected_data) { return protected_data.ppid.value(); });
return ppid().value();
}
ErrorOr<FlatPtr> Process::sys$get_process_name(Userspace<char*> buffer, size_t buffer_size)