RLIMIT NICE in glibc
Michael T Kerrisk
mtk-lists@gmx.net
Wed Aug 17 12:06:00 GMT 2005
Ulrich,
In sysdeps/unix/sysv/linux/bits/resource.h there is nowadays
the following:
/* Maximum nice priority allowed to raise to.
Nice levels 19 .. -20 correspond to 0 .. 39
values of this resource limit. */
__RLIMIT_NICE = 13,
#define RLIMIT_NICE __RLIMIT_NICE
After the following report:
http://marc.theaimsgroup.com/?l=linux-kernel&m=112256338703880&w=2
there was general agreement that RLIMIT_NICE and [gs]etpriority()
should deal with consistent ranges:
http://marc.theaimsgroup.com/?l=linux-kernel&m=112262779828552&w=2
http://marc.theaimsgroup.com/?l=linux-kernel&m=112266870621366&w=2
and the following patch is likely to be applied for 2.6.13:
http://marc.theaimsgroup.com/?l=linux-kernel&m=112413714425177&w=2
So the comment in the glibc code should be edited:
s/0 .. 39/1 .. 40/
However, I have a more general suggestion: would it be
sensible to have glibc's wrappers for setrlimit()/getrlimit()
include extra code to handle RLIMIT_NICE so that callers
would get/set values in the range +19 .. -20 for this limit?
This would be consistent with the +19 .. -20 range that is
exposed in user-space by the Linux setpriority() system call
and the glibc wrapper for getpriority().
Cheers,
Michael
--
Michael Kerrisk
mtk-lists@gmx.net
GMX DSL = Maximale Leistung zum minimalen Preis!
2000 MB nur 2,99, Flatrate ab 4,99 Euro/Monat: http://www.gmx.net/de/go/dsl
More information about the Libc-alpha
mailing list