PROC_CTL(2)

NAME
proc_ctl - control over various process attributes

SYNOPSIS
#include <sys/time.h>
#include <sys/resource.h>
proc_ctl(cmd, who, arg)
int	cmd;
int	who;
int	arg;

DESCRIPTION
This call supports manipulation of various process attributes. The only currently supported “cmd” is PROC_PRIOAGE. Cmd, who, and arg are interpreted as follows:

cmd = PROC_PRIOAGE
    “who” is a process ID (pid); zero means the calling process. Priority aging of the selected process is enabled or disabled depending on arg being non-zero or zero (respectively). When priority aging is disabled, DYNIX no longer takes the calling process's CPU usage history into consideration when selecting among processes to run. The calling process's effective uid must be root or the same as the selected process. Any uid can enable priority aging with the “arg” argument. A root process, or any process if the system is configured for it, can disable priority aging. Zero (0) indicates no aging. One (1) enables aging. The priority aging attribute is inherited across fork and exec.

RETURN VALUE
Upon successful completion, a value of 0 is returned. Otherwise, a value of -1 is returned and errno is set to indicate the error.

ERRORS
Proc_ctl will fail if one or more of the following are true:

[EINVAL]
    Cmd is not one of the supported values.

[EPERM]
    Caller is not root for disabling priority aging, and the binary configuration disallows this.

[EPERM]
    The caller is not root and the effective uid is not the same as the selected process.

[ESRCH]
    who specifies a non-existent process.

SEE ALSO
setpriority(2), vm_ctl(2)

NOTES
Binary configuration of ability for non-root processes to disable priority aging is provided via a variable in /sys/conf/param.c: root_prio_noage. If this variable is non-zero, only root can disable priority aging.