diff options
author | Richard Braun <rbraun@sceen.net> | 2013-05-31 01:26:54 +0200 |
---|---|---|
committer | Richard Braun <rbraun@sceen.net> | 2013-05-31 01:26:54 +0200 |
commit | 29bb544f8059ae8460cfcfb2563a7731f15d1cb1 (patch) | |
tree | c48bac537bcea0ea90c1c17c396454e704f48c9b | |
parent | 14b8631823483fd26e03b5ed38b1d4125a462dd0 (diff) |
Reset task priority when spawning a passive translator
Server threads spawned by libports attempt to adjust their priority and
succeed when the server is privileged. This priority is currently
inherited by child tasks, which could be passive translators owned by
unprivileged users. Reset the priority of the task used for translator
instantiation.
* libfshelp/start-translator-long.c (fshelp_start_translator_long): Set
new task priority to 25 (BASEPRI_USER).
-rw-r--r-- | libfshelp/start-translator-long.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/libfshelp/start-translator-long.c b/libfshelp/start-translator-long.c index 5bf14541..55fb0ff6 100644 --- a/libfshelp/start-translator-long.c +++ b/libfshelp/start-translator-long.c @@ -226,6 +226,14 @@ fshelp_start_translator_long (fshelp_open_fn_t underlying_open_fn, if (err) goto lose; + /* XXX 25 is BASEPRI_USER, which isn't exported by the kernel. Ideally, + nice values should be used, perhaps with a simple wrapper to convert + them to Mach priorities. */ + err = task_priority(task, 25, FALSE); + + if (err) + goto lose; + /* Designate TASK as our child and set it's owner accordingly. */ proc = getproc (); proc_child (proc, task); |