[Overview][Constants][Types][Procedures and functions][Variables][Index] | Reference for unit 'oldlinux' (#rtl)

# SetPriority

Set process priority

## Declaration

Source position: oldlinux.pp line 1358

`procedure SetPriority(`
`Which: Integer;`
`Who: Integer;`
`What: 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 constants:

Prio_Process
  Who is interpreted as process ID
Prio_PGrp
  Who is interpreted as process group ID
Prio_User
  Who is interpreted as user ID

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

For an example, see Nice.

## 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 |  | Return process priority
Nice |  | Set process priority

Documentation generated on: Feb 26 2014