30 lines
866 B
Plaintext
30 lines
866 B
Plaintext
From e1f3cb8a03ad80ddd92c1c194a95334dce2f793f Mon Sep 17 00:00:00 2001
|
|
From: Sergei Reznikov <diver@gelios.net>
|
|
Date: Fri, 25 Mar 2016 14:36:50 +0300
|
|
Subject: Haiku doesn't have {get,set}priority yet
|
|
|
|
|
|
diff --git a/Process.c b/Process.c
|
|
index 8e2abb6..c5e7680 100644
|
|
--- a/Process.c
|
|
+++ b/Process.c
|
|
@@ -520,6 +520,7 @@ void Process_toggleTag(Process* this) {
|
|
bool Process_setPriority(Process* this, int priority) {
|
|
uid_t euid = geteuid();
|
|
(void) seteuid(getuid());
|
|
+#ifdef HAVE_SETPRIORITY
|
|
int old_prio = getpriority(PRIO_PROCESS, this->pid);
|
|
int err = setpriority(PRIO_PROCESS, this->pid, priority);
|
|
(void) seteuid(euid);
|
|
@@ -527,6 +528,7 @@ bool Process_setPriority(Process* this, int priority) {
|
|
this->nice = priority;
|
|
}
|
|
return (err == 0);
|
|
+#endif
|
|
}
|
|
|
|
bool Process_changePriorityBy(Process* this, size_t delta) {
|
|
--
|
|
2.13.1
|
|
|