Svante Signell, on Wed 31 Aug 2016 14:10:22 +0200, wrote: > On Wed, 2016-08-31 at 13:51 +0200, Samuel Thibault wrote: > > Svante Signell, on Wed 31 Aug 2016 13:42:58 +0200, wrote: > > > > > > > > > Which is the original bug then? > > You didn't say what application you are actually trying to fix, but the > > issue you have shown is that task_priority returns permission denied > > when change_threads is true (and I guessed you want that to work as > > normal user). I just said that the test was expected to have issues > > since the nice value is negative. > > The application is openntpd, which I'm working on porting and ntpd where this > call is made requires you to be root.
Ok. Please always provide such information from the beginning, so we don't have to divine it. > I would expect values [-20,19] to be OK converted to [5,44] with > #define NICE_TO_MACH_PRIORITY(nice) ((nice) + 25) from hurd/hurd/resource.h > and > #define invalid_pri(pri) (((pri) < 0) || ((pri) >= NRQS)), where NRQS = 50 > from kern/sched.h. > to work. Yes, but see the code changing thread priorities (since that's what is posing problem) > In fact, according to invalid_pri(pri) the range could be [-26,25]. but that > would not make sense, right? It does not really matter. Linux' notion of nice values is already not really POSIX for root :) (POSIX doesn't define negative nice values). Samuel