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