getquantum(2) getquantum(2)
NAME
getquantum, setquantum - get/set process time quantum
SYNOPSIS
#include <sys/resource.h>
#include <sys/time.h>
prio = getquantum (who)
int who;
int setquantum (which, who, quantum)
int which, who, quantum;
DESCRIPTION
The time quantum of the process as indicated by who is
obtained with the getquantum call and set with the setquan-
tum call. Which is one of
PRIO_PROCESS process id
PRIO_PGRP process group id
PRIO_USER user id
and who is interpreted relative to which (a process identif-
ier for PRIO_PROCESS, process group identifier for
PRIO_PGRP, and a user ID for PRIO_USER). Quantum is a posi-
tive value indicating a time quantum, in clock ticks.
The getquantum call returns the time quantum, in clock
ticks, of the specified process. The setquantum call sets
the time quantum of all of the specified processes to the
specified value. Only the super-user or a user with the
ACC_SETPRI privilege can increase a time quantum.
RETURN VALUE
Upon successful completion, getquantum returns the time
quantum, in clock ticks, of the specified process; setquan-
tum returns 0. If not successful, -1 is returned and errno
is set to indicate the error.
ERRORS
getquantum and setquantum may return one of the following
errors:
[ESRCH] No process(es) were located using the which
and who values specified.
[EINVAL] Which was not one of PRIO_PROCESS, PRIO_PGRP,
or PRIO_USER.
In addition to the errors indicated above, setquantum may
fail with one of the following errors returned:
Page 1 CX/UX Programmer's Reference Manual
getquantum(2) getquantum(2)
[EACCES] The time quantum specified was not positive.
[EACCES] A process was located, but neither its effec-
tive nor real user ID matched the effective
user ID of the caller.
[EACCES] The caller attempted to increase a time quan-
tum and the caller does not have an effective
user ID equal to the super-user and the
caller does not have the ACC_SETPRI privilege
(if access vectors are configured).
SEE ALSO
nice(1), fork(2), nice(2), setpriority(2), renice(1)
Page 2 CX/UX Programmer's Reference Manual