setprio

set the priority of a process

Synopsis:

#include <sys/sched.h>
int setprio( pid_t pid, int prio );

Description:

The setprio() function changes the priority of process pid to priority prio. If pid is zero, the priority of the calling process is set.

The prio parameter must lie between 1 (lowest) and 29 (highest for super user) or 19 (highest for non-super user).

By default, the process priority and scheduling algorithm are inherited from or explicitly set by the process that created it. Once running, the process may change its priority by using this function.

Returns:

The setprio() function returns the previous priority on success. On error, it returns (-1), and errno is set.

Errors:

EINVAL
The priority prio is not a valid priority.
EPERM
The calling process does not have sufficient privilege to set the priority.
ESRCH
The process pid does not exist.

See also:

errno, getprio(), qnx_scheduler(), sched_getparam(), sched_getscheduler(), sched_setscheduler(), sched_yield()

Examples:

See qnx_scheduler().

Classification:

QNX

Systems:

QNX