killjob(2)killjob(2)NAMEkilljob - terminates all processes for the specified job
SYNOPSIS
#include <sys/resource.h>
int killjob(jid_t jid, int signal)
DESCRIPTION
The killjob function sends a kill signal to terminate all processes for
the specified job ID. The killjob function checks the credentials of the
calling function versus the credentials of each process it is signaling.
If the MAC_WRITE label on the job being terminated is different from the
calling process, then the killjob function checks for the CAP_KILL
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 killjob function fails and sets errno
to:
[ENOPKG] The job limits software is not installed.
[EINVAL] Signal is not a valid signal number.
[ENOJOB] A job with the specified job ID cannot be found.
[ESRCH] No process can be found which belongs to the job jid.
This can occur in cases where all the processes of a job
have exited and the job has been set to wait for a process
to call waitjob(2) with setwaitjobpid(2).
[EPERM] The calling process does not have permission to kill any
processes in the job.
SEE ALSOkilljob(2), makenewjob(2), waitjob(2), setwaitjobpid(2),
jlimit_startjob(3c), killpg(3B).
DIAGNOSTICS
Upon successful completion, killjob returns a value of 0. Otherwise, a
value of -1 is returned and errno is set to indicate the error.
Page 1