mirror of
https://github.com/Mathewnd/Astral.git
synced 2026-10-27 12:48:22 +00:00
nice: add auth handling
This commit is contained in:
@@ -1,15 +1,12 @@
|
||||
#include <kernel/syscalls.h>
|
||||
#include <kernel/thread.h>
|
||||
#include <kernel/auth.h>
|
||||
#include <arch/cpu.h>
|
||||
|
||||
syscallret_t syscall_nice(context_t *, int nice) {
|
||||
syscallret_t ret;
|
||||
|
||||
|
||||
if (nice < 0) {
|
||||
|
||||
}
|
||||
|
||||
ret.errno = nice < 0 ? auth_process_check(¤t_thread()->proc->cred, AUTH_ACTIONS_PROCESS_NICE, NULL) : 0;
|
||||
current_thread()->proc->nice = max(min(current_thread()->proc->nice + nice, SCHED_NICE_MAX), SCHED_NICE_MIN);
|
||||
|
||||
ret.ret = current_thread()->proc->nice;
|
||||
|
||||
Reference in New Issue
Block a user