Set the priority of a process
#include <sched.h> int setprio( pid_t pid, int prio );
- The process ID of the process whose priority you want to set.
- The new priority.
Use the -l c option to qcc to link against this library. This library is usually included automatically.
The setprio() function changes the priority of thread 1 of process pid to priority prio. If pid is zero, the priority of the calling thread is set.
The previous priority, or -1 if an error occurred (errno is set).
- The priority prio isn't a valid priority.
- The calling process doesn't have sufficient privilege to set the priority.
- The process pid doesn't exist.