getjusage(2)

getjusage - get job usage information

As shipped in IRIX 6.5.15. Last changed in IRIX 6.5.15.

NAME
     getjusage - get job usage information

SYNOPSIS
     #include <sys/resource.h>

     int getjusage(jid_t jid, int resource, struct jobrusage *up)

DESCRIPTION
     The getjusage function retrieves the resource usage values for the
     specified job ID.  If the jid parameter is zero, usage values for the
     current job will be returned.  If jid is non-zero, it represents the job
     ID of the job for which usages values are retrieved.  The resource
     parameter specifies the resource for which the usage values are returned.
     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 will be returned.

     If the current job ID is different from the job ID being requested, the
     getjusage function checks for the CAP_MAC_READ 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 getjusage 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.

SEE ALSO
     getjlimit(2), getrusage(3).

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