Go to the previous, next section.

getpriority and setpriority

SYNOPSIS

int getpriority(int which, int who);

int setpriority(int which, int who, int prio);

PARAMETERS

which: [in] which kind of taks to work on.

who: [in] who exactly we want to work on.

prio: [in] the new priority.

DESCRIPTION

getpriority retreives the highest priority of a task, a process group or a user and setpriority sets the priority of a task, all process in a process group or a user. which and have the following values:

PRIO_PROCESS
to get the priority of a process. In this case who is a process id.

PRIO_PGRP
to get the priority of a process group. In this case who is a process group id.

PRIO_USER
to get the priority of a user. In this case who is a user id.

In any case, a value of zero for who means the current process, process group or user. prio is in the range [-20,20] with lower values giving a higher scheduling priority.

RETURN VALUE

getpriority returns something between -20 and 20. setpriority returns 0 on success and -1 on error. In case of errorm, errno is set to one of the following values:

Go to the previous, next section.