waitjob(2)
waitjob - obtain information about a completed job
As shipped in IRIX 6.5.30. Last changed in IRIX 6.5.19.
NAME waitjob - obtain information about a completed job SYNOPSIS #include <sys/resource.h> jid_t waitjob(job_info_t *jobinfo) DESCRIPTION Under normal conditions, when all the processes of a job have exited, the job construct is destroyed. The desctruction of a job can be delayed to allow job information to be retrieved with waitjob. The setwaitjobpid call is used to delay the destruction of a job by setting a process which can use waitjob to obtain job information. A job whose processes have exited and its destruction has been delayed is called a zombie job. The zombie job remains until the process specified with setwaitjobpid exits or calls waitjob. Only the process whose pid is set with setwaitjobpid can retrieve the zombie job's information. The waitjob function does not block caller's execution. The waitjob function takes one arguement, a pointer to a job_info_t structure. The structure contains: the terminated job's job id, the job limit enforcement flag that tells what enforcement action was taken on that job, the job's start time, the job's uid initiator, and the job's limit information. Enforcement flags include: JL_CPU_SIGXCPU Process in job exceeded CPU time in seconds and was sent SIGXCPU. Enforcement of the JLIMIT_CPU limit. JL_CPU_SIGKILL Process in job is terminated with the SIGKILL signal. The JLIMIT_CPU limit was enforced. JL_DATA Process in job attempted to exceed the job's maximum heap size. Enforcement of the JLIMIT_DATA limit. JL_VMEM Maximum reached for job's mapped address space. The JLIMIT_VMEM limit was enforced. JL_RSS Maximum size of job's resident set size reached. The JLIMIT_RSS limit was enforced. JL_NOFILE Maximum number of open file descriptors for the job was reached. Enforcement of the JLIMIT_NOFILE occurred. JL_PTHREAD The JLIMIT_PTHREAD enforcement flag when maximum number of pthreads is reached. JL_NUMPROC Maximum number of processes in a job reached, JLIMIT_NUMPROC limit enforced. JL_PMEM Job's maximum amount of physical memory reached. The JLIMIT_PMEM limit was enforced. The waitjob function returns the terminated job's job id if successful. ERRORS Under the following conditions, the function waitjob sets errno to: [ENOPKG] The job limits software is not installed. [ENOJOB] The calling process is not associated with a zombie job. [EFAULT] jobinfo points to an invalid address. SEE ALSO systune(1M), setwaitjobpid(2). DIAGNOSTICS Upon successful completion, waitjob returns the terminated job's job id. If an error occurs, a value of -1 is returned and errno is set to indicate the error.