summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--libports/manage-multithread.c5
-rw-r--r--proc/main.c7
2 files changed, 11 insertions, 1 deletions
diff --git a/libports/manage-multithread.c b/libports/manage-multithread.c
index 1588f632..576e7670 100644
--- a/libports/manage-multithread.c
+++ b/libports/manage-multithread.c
@@ -68,6 +68,11 @@ adjust_priority (unsigned int totalthreads)
goto error_pset_priv;
err = thread_max_priority (self, pset_priv, 0);
+ /* If we are running in an unprivileged subhurd, we got a faked
+ privileged processor set port. This is indeed a kind of
+ permission problem, and we treat it as such. */
+ if (err == KERN_INVALID_ARGUMENT)
+ err = EPERM;
if (err)
goto error_max_priority;
diff --git a/proc/main.c b/proc/main.c
index c4936f68..2c5ce553 100644
--- a/proc/main.c
+++ b/proc/main.c
@@ -80,6 +80,11 @@ increase_priority (void)
goto out;
err = thread_max_priority (mach_thread_self (), psetcntl, 0);
+ /* If we are running in an unprivileged subhurd, we got a faked
+ privileged processor set port. This is indeed a kind of
+ permission problem, and we treat it as such. */
+ if (err == KERN_INVALID_ARGUMENT)
+ err = EPERM;
if (err)
goto out;
@@ -155,7 +160,7 @@ main (int argc, char **argv, char **envp)
/* Give ourselves good scheduling performance, because we are so
important. */
err = increase_priority ();
- if (err)
+ if (err && err != EPERM)
error (0, err, "Increasing priority failed");
err = register_new_task_notification (_hurd_host_priv,