setjusage(2)setjusage(2)NAMEsetjusage - set job usage information
SYNOPSIS
#include <sys/resource.h>
int setjusage(jid_t jid, int resource, struct jobrusage *up)
DESCRIPTION
The setjusage function updates the resource usage values for the
specified job ID. If the jid parameter is zero, usage values for the
current job will be updated. If jid is non-zero, it represents the job
ID of the job for which usages values are updated. The resource
parameter specifies the resource for which the usage values are to be
updated. Allowable values are taken from the JLIMIT_xxx macros found in
the sys/resource.h file. For example, the JLIMIT_CPU macro is for cpu
time. The up parameter points to a jobrusage structure in the user
program where the usage values are stored.
To be able to update resource usage values using setjusage, the job must
be ignoring the accumulation and enforcement of the limits for the
specified resource. It is determined at job creation if it will be
ignoring specific resource limits, based upon the values of the following
system tunable parameters:
[jlimit_pmem_ign]
Ignore the accumulation and enforcement of the total
aggregate physical memory usage for the job.
[jlimit_numproc_ign]
Ignore the accumulation and enforcement of limits on the
number of processes in the job.
[jlimit_pthread_ign]
Ignore the accumulation and enforcement of the number of
pthreads in the job.
[jlimit_nofile_ign]
Ignore the accumulation and enforcement of the number of
open files in the job.
[jlimit_rss_ign]
Ignore the accumulation and enforcement of the total
aggregate resident set size for the job.
[jlimit_vmem_ign]
Ignore the accumulation and enforcement of total aggregate
virtual memory size for the job. for all proce
[jlimit_data_ign]
Ignore the accumulation and enforcement of total aggregate
data segment size for the job.
Page 1
setjusage(2)setjusage(2)
[jlimit_cpu_ign]
Ignore the accumulation and enforcement of CPU time usage
for the job.
The values for these tunable parameters can be changed at run-time. By
default these values are set so that the accumulation and enforcement of
resource usage limits are not ignored. Changing these values at run-time
will only affect the behavior of jobs created after the parameter was
changed. Those jobs that existed prior to the parameter being changed
will continue with unchanged concerning the accumulation and enforcement
of job limits for resource usage.
For additional information concering system tunable parameters, please
see the systune(1M) man page.
The process attempting to use setjusage must have the CAP_PROC_MGT
capability. See the capability(4) and capabilities(4) man pages for more
information on the capability mechanism that provides fine grained
control over the privileges of a process.
ERRORS
Under the following conditions, the setjusage function fails and sets
errno to:
[ENOPKG] The job limits software is not installed.
[ENOJOB] A job with the specified job ID cannot be found.
[ENOACCES] The process does not have the appropriate privileges, so
permission to set the job usage value is denied.
[ENOPERM] The resource limit accumulation and enforcement is not
being ignored by the job, so the operation is not
permitted.
SEE ALSOsystune(1M), getrusage(3).
DIAGNOSTICS
Upon successful completion, setjusage returns a value of 0. Otherwise, a
value of -1 is returned and errno is set to indicate the error.
Page 2