Skip to content

fpNice

Set process priority

Declaration

Source position: bunxh.inc line 104

  function fpNice(N: cint) : cint;

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.

If the function is successful, zero is returned. On error, a nonzero value is returned.

Errors

Extended error information is returned by the FpGetErrno function.

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

See also

Name Description
FpGetPriority Return process priority
FpSetPriority Set process priority

Example

Program Example15;
{ Program to demonstrate the Nice and Get/SetPriority functions. }
Uses BaseUnix,Unix;
begin
  writeln ('Setting priority to 5');
  fpsetpriority (prio_process,fpgetpid,5);
  writeln ('New priority = ',fpgetpriority (prio_process,fpgetpid));
  writeln ('Doing nice 10');
  fpnice (10);
  writeln ('New Priority = ',fpgetpriority (prio_process,fpgetpid));
end.