[Previous]
[Contents]
[Next]

sched_setparam()

change the priority of a process

Synopsis:

#include <sys/sched.h>
int sched_setparam( pid_t pid,
                    struct sched_param *param );

Description:

The sched_setparam() function changes the priority of process pid (or the calling process if pid is zero) to that of the sched_priority member in the sched_param structure pointed to by param.

The sched_priority member must lie between the minimum and maximum values defined in <sys/sched.h>.

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

Returns:

The sched_setparam() function returns zero on success. On error, a -1 is returned, and errno is set.

Errors:

EINVAL
The priority 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:

POSIX 1003.4

Safety:
Interrupt handler No
Signal handler Yes, but modifies errno
Thread Yes

See also:

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


[Previous]
[Contents]
[Next]