Hi,
On Sat, Apr 11, 2026 at 06:15:42AM +0100, Michael Kelly wrote:
>
> Once I've completed the required change to adjtime() I can have a look at
> these too.
>
Sure, no worries, I'm not trying to push you. I'm just looking where I can help
:)
The good news is that all that complex GLIBC code is probably not a problem.
I made a little reproduction program that calls task_priority directly and
the issue appears to be when GNU Mach is asked to change all threads.
demo@debian:~/dev/tests$ sudo ./task_priority
task_priority (5, 0) => 0 (0x0)
task_priority (5, 1) => 5 (0x5)
./task_priority: error setting task priority: (os/kern) failure
I attach the test program source code.
Maybe the next step could be to add little test to the GNU Mach
test suite.
Thanks,
Diego
#include <error.h>
#include <mach/gnumach.h>
#include <mach/mach.h>
#include <stdio.h>
int main (int argc, char **argv)
{
kern_return_t err;
mach_port_t task = mach_task_self ();
err = task_priority (task, 5, 0);
if (err != KERN_SUCCESS)
{
printf ("task_priority (5, 0) => %d (0x%x)\n", err, err);
error (1, err, "error setting task priority");
}
printf ("task_priority (5, 0) => %d (0x%x)\n", err, err);
err = task_priority (task, 5, 1);
if (err != KERN_SUCCESS)
{
printf ("task_priority (5, 1) => %d (0x%x)\n", err, err);
error (1, err, "error setting task priority");
}
printf ("task_priority (5, 1) => %d (0x%x)\n", err, err);
return 0;
}