netbsd-bugs@netbsd.org
[Top] [All Lists]

kern/41489: setpriority(2) returns EACCES instead of EPERM

Subject: kern/41489: setpriority(2) returns EACCES instead of EPERM
From:
Date: Mon, 25 May 2009 14:40:41 UTC
Newsgroups: fa.netbsd.bugs

>Number:         41489
>Category:       kern
>Synopsis:       setpriority(2) returns EACCES instead of EPERM
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    kern-bug-people
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Mon May 25 14:40:01 +0000 2009
>Originator:     Stathis Kamperis
>Release:        NetBSD 5.0_STABLE
>Organization:
Aristotle University of Thessaloniki
>Environment:
NetBSD voyager 5.0_STABLE NetBSD 5.0_STABLE (GENERIC) #10: Fri May 22 17:59:56 
EEST 2009  stathis@voyager:/usr/obj/sys/arch/i386/compile/GENERIC i386

>Description:
According to POSIX's description for setpriority(2):

[EPERM]
    A process was located, but neither the real nor effective user ID of the 
executing process match the effective user ID of the process whose nice value 
is being changed.

OTOH, if I try to change the priority of init process I get EACCES. Mind that I 
don't try to increase/lower it. I just re-set it to 0.
>How-To-Repeat:
Call this and examine errno variable:

setpriority(PRIO_PROCESS, /* init */ 1, /* nice */ 0);

>Fix:


<Prev in Thread] Current Thread [Next in Thread>