![]()  | 
![]()  | 
![]()  | 
![]()  | 
Set the priority of a process
#include <sched.h>
int setprio( pid_t pid, 
             int prio );
libc
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).
| Safety: | |
|---|---|
| Cancellation point | No | 
| Interrupt handler | No | 
| Signal handler | Yes | 
| Thread | Yes | 
The getprio() and setprio() functions are included in the QNX Neutrino libraries for porting QNX 4 applications. For new programs, use sched_setparam(), pthread_setschedparam(), or pthread_setschedprio().
errno, getprio(), pthread_getschedparam(), pthread_setschedparam(), pthread_setschedprio(), sched_getparam(), sched_get_priority_max(), sched_get_priority_min(), sched_getscheduler(), sched_setscheduler(), sched_yield()
“Thread scheduling” in the QNX Neutrino Microkernel chapter of the System Architecture guide
“Scheduling policies” in the Programming Overview chapter of the QNX Neutrino Programmer's Guide
![]()  | 
![]()  | 
![]()  | 
![]()  |