next up previous contents index
Next: Shell Up: Functions and procedures Previous: SelectText

SetPriority

   

Declaration:

Function SetPriority (Which,Who,Prio : Integer) : Integer;

Description:

SetPriority sets the priority with which a process is running. Which process(es) is determined by the Which and Who variables. Which can be one of the pre-defined Prio_Process, Prio_PGrp, Prio_User, in which case Who is the process ID, Process group ID or User ID, respectively.

Prio is a value in the range -20 to 20.

Errors:

Error checking must be done on LinuxError, since a priority can be negative.

sys_esrch
No process found using which and who.
sys_einval
Which was not one of Prio_Process, Prio_Grp or Prio_User.
sys_eperm
A process was found, but neither its effective or real user ID match the effective user ID of the caller.
sys_eacces
A non-superuser tried to a priority increase.

See also:

GetPriority, Nice, Setpriority (2)

For an example, see Nice.



Michael Van Canneyt
Thu Sep 10 13:59:33 CEST 1998