Bug#286825: glibc: nice() should set errno=EPERM not EACCES on error
Package: glibc
Version: 2.3.2.ds1-19
Hi, according to the man page and
http://www.opengroup.org/onlinepubs/009695399/functions/nice.html
nice() should set errno=EPERM in case the incr argument is negative and
the calling process does not have appropriate privileges.
$ cat test.c
#include <errno.h>
int main() {
if (nice(-1) == -1) printf("%d\n", errno);
}
$ gcc test.c && ./a.out
13
$ grep 13 /usr/include/asm-generic/errno-base.h
#define EACCES 13 /* Permission denied */
$
Regards, Gerrit.
Reply to: