[Previous] [Contents] [Next]

setprio()

Set the priority of a process

Synopsis:

#include <sched.h>

int setprio( pid_t pid, 
             int prio );

Library:

libc

Description:

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.

Returns:

The previous priority, or -1 if an error occurred (errno is set).

Errors:

EINVAL
The priority prio isn't a valid priority.
EPERM
The calling process doesn't have sufficient privilege to set the priority.
ESRCH
The process pid doesn't exist.

Classification:

QNX 4

Safety:
Cancellation point No
Interrupt handler No
Signal handler Yes
Thread Yes

Caveats:

The getprio() and setprio() functions are included in the QNX 6 libraries for porting QNX 4 applications; they shouldn't be used in new multi-threaded programs.

See also:

errno, getprio(), sched_getparam(), sched_get_priority_max(), sched_get_priority_min(), sched_getscheduler(), sched_setscheduler(), sched_yield()


[Previous] [Contents] [Next]