NetBSD-Bugs archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: lib/42587: nice() returns EACCES instead of (standard mandated) EPERM



The following reply was made to PR lib/42587; it has been noted by GNATS.

From: christos%zoulas.com@localhost (Christos Zoulas)
To: gnats-bugs%NetBSD.org@localhost, lib-bug-people%netbsd.org@localhost, 
        gnats-admin%netbsd.org@localhost, netbsd-bugs%netbsd.org@localhost
Cc: 
Subject: Re: lib/42587: nice() returns EACCES instead of (standard mandated) 
EPERM
Date: Wed, 6 Jan 2010 13:23:48 -0500

 On Jan 6,  3:45pm, ekamperi%gmail.com@localhost (ekamperi%gmail.com@localhost) 
wrote:
 -- Subject: lib/42587: nice() returns EACCES instead of (standard mandated) E
 
 | >Number:         42587
 | >Category:       lib
 | >Synopsis:       nice() returns EACCES instead of (standard mandated) EPERM
 | >Confidential:   no
 | >Severity:       non-critical
 | >Priority:       low
 | >Responsible:    lib-bug-people
 | >State:          open
 | >Class:          sw-bug
 | >Submitter-Id:   net
 | >Arrival-Date:   Wed Jan 06 15:45:00 +0000 2010
 | >Originator:     Stathis Kamperis
 | >Release:        5.0.1
 | >Organization:
 | >Environment:
 | NetBSD 5.0.1 GENERIC/i386 (sorry, handwritter :-))
 | >Description:
 | Quoting from (same applies to Issue 7):
 | http://www.opengroup.org/onlinepubs/000095399/functions/nice.html
 | 
 | The nice() function shall fail if:
 | [EPERM]
 |     The incr argument is negative and the calling process does not have
 |      appropriate privileges.
 | 
 | Linux + OpenSolaris do it right. *BSD I tried return wrong error code.
 | 
 | 
 | >How-To-Repeat:
 | Call nice(-2) from a non-privileged program and check errno variable. It is 
EACCES, instead of EPERM.
 | 
 | 
 | Trivial test case here may be found here:
 | 
http://gitweb.dragonflybsd.org/~beket/pcca-tests.git/blob_plain/master:/unistd.h/t_nice.c
 | >Fix:
 | http://nxr.netbsd.org/source/xref/src/sys/kern/kern_resource.c#310
 
 That will break setpriority(2). You need to make the change in nice(3).
 
 christos
 


Home | Main Index | Thread Index | Old Index