[PATCH] chpst: fix error check of nice(2) call

Denys Vlasenko vda.linux at googlemail.com
Mon Dec 9 01:10:02 UTC 2024


Applied, thank you

On Sun, Dec 1, 2024 at 2:06 PM Christian Franke
<Christian.Franke at t-online.de> wrote:
>
> This prevents that "chpst -n -1 PROG" always fails if the current nice
> value is 0.
>
> SUS 1997 to POSIX 2024 require that nice(2) returns the new nice value
> on success. The nice value may be -1. The native system call of older
> Linux returns 0 on success, but Linux with glibc >= 2.2.4 provides POSIX
> conformance. FreeBSD still returns 0 on success. Ancient Unix returned
> nothing, BTW :-)
>
> https://pubs.opengroup.org/onlinepubs/007908799/xsh/nice.html
> https://pubs.opengroup.org/onlinepubs/9799919799/functions/nice.html
> https://man7.org/linux/man-pages/man2/nice.2.html
> https://man.freebsd.org/cgi/man.cgi?query=nice&sektion=3
> http://man.cat-v.org/unix_10th/2/nice
>
> --
> Regards,
> Christian
>
> _______________________________________________
> busybox mailing list
> busybox at busybox.net
> https://lists.busybox.net/mailman/listinfo/busybox


More information about the busybox mailing list