Sets a process scheduling priority to a constant value.
#include <sys/sched.h>
int setpri ( ProcessID, Priority)
pid_t ProcessID;
int Priority;
The setpri subroutine sets the scheduling priority of all threads in a process to be a constant. All threads have their scheduling policies changed to SCHED_RR. A process nice value and CPU usage can no longer be used to determine a process scheduling priority. Only processes that have root user authority can set a process scheduling priority to a constant.
Upon successful completion, the setpri subroutine returns the former scheduling priority of the process just changed. Otherwise, a value of -1 is returned and the errno global variable is set to indicate the error.
The setpri subroutine
is unsuccessful if one or more of the following is true:
This subroutine is part of Base Operating System (BOS) Runtime.
The getpri subroutine.
Performance-Related Subroutines in AIX 5L Version 5.1 Performance Management Guide.