Add read-only option

Add command line option to disable all system and process changing
features.
This commit is contained in:
Christian Göttsche
2021-01-21 20:27:37 +01:00
committed by cgzones
parent 812cfcb94d
commit 36880cd61c
12 changed files with 108 additions and 42 deletions

View File

@ -482,6 +482,9 @@ bool Process_isTomb(const Process* this) {
}
bool Process_setPriority(Process* this, int priority) {
if (Settings_isReadonly())
return false;
int old_prio = getpriority(PRIO_PROCESS, this->pid);
int err = setpriority(PRIO_PROCESS, this->pid, priority);