[patch] nice.2: wfix

Alejandro Colomar alx.manpages@gmail.com
Wed Dec 14 17:38:44 GMT 2022


Hi Jakub!

On 12/14/22 16:28, Jakub Wilk wrote:
> * Alejandro Colomar <alx.manpages@gmail.com>, 2022-12-11 18:33:
>>> -to the nice value for the calling thread.
>>> +to the nice value for the calling process.
> 
> nice() affecting the whole process, not just the calling thread, is what POSIX 
> requires, and what glibc documents, but it's not actually how it works on Linux 
> at the moment[*].
> 
> This is documented in the setpriority(2) man page:
> 
> "According to POSIX, the nice value is a per-process setting. However, under the 
> current Linux/NPTL implementation of POSIX threads, the nice value is a 
> per-thread attribute: different threads in the same process can have different 
> nice values. Portable applications should avoid relying on the Linux behavior, 
> which may be made standards conformant in the future."
> 
> It would be prudent to document this bug in the nice(2) man page too.
> 
> 
> [*] I've tested this with Linux 6.0 + glibc 2.36.
> See the attached test program.

I think that patch would be a great example for the page.  Would you mind 
sending it as a patch?

Thanks,

Alex

> 

-- 
<http://www.alejandro-colomar.es/>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: OpenPGP_signature
Type: application/pgp-signature
Size: 833 bytes
Desc: OpenPGP digital signature
URL: <https://sourceware.org/pipermail/libc-alpha/attachments/20221214/9f6cf22c/attachment.sig>


More information about the Libc-alpha mailing list