On 09/11/2025 07:17, Collin Funk wrote:
Collin Funk <[email protected]> writes:

That test program assumes that nice() does not clamp the niceness to the
supported range as it is supposed to [1]. This is the case on GNU/Hurd,
so I will submit a bug report for that later.

The output is the same on a normal and privileged user:

     $ gcc main.c ./a.out
     starting nice: 0
     minimum nice: 0
     maximum nice: 38
     minimum errno: EPERM
     maximum errno: ESRCH

This patch clamps it to the supported range and adds some tests. Here is
the corrected behavior:

     $ ./src/nice -n +100 ./src/nice
     38

Actually my original patch did not work if 'nice' was invoked with a
niceness greater than zero. This v2 patch fixes that and adds more
tests.

That's restricted to Hurd so looks safe to push.

thanks,
Padraig

Reply via email to