From Bugzilla Helper: User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.6) Gecko/20040510 Description of problem: (Apologies for putting this in coreutils, I'm not exactly sure where this goes as it relates (I think) to my renice bug.) Core using setpriority(2) only allows an increase in priority, rather than a decrease. Using a line like res = setpriority(PRIO_PROCESS, pid, prio); will result in a failure if prio is smaller than the current priority of pid. Increasing the priority returns success. Version-Release number of selected component (if applicable): How reproducible: Always Steps to Reproduce: 1. Compile attached reniceit.c 2. Select process (Mozilla for example) and get PID 3. Run: reniceit PID 4 4. Run: reniceit PID 3 Actual Results: > reniceit 983 4 Process 983 has priority 0 Renicing process 983 to priority 4 Return value is : 0 Process 983 has priority 4 > reniceit 983 3 Process 983 has priority 4 Renicing process 983 to priority 3 Return value is : -1 Process 983 has priority 4 Expected Results: Process should change priority. Additional info: I think this is an indication of the problems in using both the renice command and top to renice processes. As to the cause ?????
Created attachment 100832 [details] Code to renice a process This code is a simple example of how setpriority(2) will fail.
Lower numbers are higher priority. See man 2 setpriority.