summaryrefslogtreecommitdiff
path: root/Kernel/Process.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'Kernel/Process.cpp')
-rw-r--r--Kernel/Process.cpp14
1 files changed, 14 insertions, 0 deletions
diff --git a/Kernel/Process.cpp b/Kernel/Process.cpp
index 7196f44e3f..779c42f6a7 100644
--- a/Kernel/Process.cpp
+++ b/Kernel/Process.cpp
@@ -3922,3 +3922,17 @@ int Process::sys$set_thread_boost(int tid, int amount)
thread->set_priority_boost(amount);
return 0;
}
+
+int Process::sys$set_process_boost(pid_t pid, int amount)
+{
+ if (amount < 0 || amount > 20)
+ return -EINVAL;
+ InterruptDisabler disabler;
+ auto* process = Process::from_pid(pid);
+ if (!process || process->is_dead())
+ return -ESRCH;
+ if (!is_superuser() && process->uid() != euid())
+ return -EPERM;
+ process->m_priority_boost = amount;
+ return 0;
+}