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

Nice

Set process priority

Declaration

Source position: oldlinux.pp line 1356

procedure Nice(

  N: Integer

);

Description

Nice adds -N to the priority of the running process. The lower the priority numerically, the less the process is favored. Only the superuser can specify a negative N, i.e. increase the rate at which the process is run.

Errors

Errors are returned in LinuxError

sys_eperm
A non-superuser tried to specify a negative N, i.e. do a priority increase.

See also

GetPriority

  

Return process priority

SetPriority

  

Set process priority

Example

Program Example15;

{ Program to demonstrate the Nice and Get/SetPriority functions. }

Uses oldlinux;

begin
  writeln ('Setting priority to 5');
  setpriority (prio_process,getpid,5);
  writeln ('New priority = ',getpriority (prio_process,getpid));
  writeln ('Doing nice 10');
  nice (10);
  writeln ('New Priority = ',getpriority (prio_process,getpid));
end.
The latest version of this document can be found at lazarus-ccr.sourceforge.net.