job_create - create a new job
#include <magenta/syscalls.h>
mx_status_t mx_job_create(mx_handle_t job, uint32_t options, mx_handle_t* out);
job_create() creates a new child job object given a parent job.
Upon success a handle for the new job is returned.
It is illegal to create a job under a parent whose MX_PROP_JOB_MAX_HEIGHT property is zero. (It is, however, legal to create a process under a parent with MAX_HEIGHT zero.) See object_get_property().
Job handles may be waited on (TODO(cpu): expand this)
job_create() returns MX_OK and a handle to the new job (via out) on success. In the event of failure, a negative error value is returned.
MX_ERR_BAD_HANDLE job is not a valid handle.
MX_ERR_WRONG_TYPE job is not a job handle.
MX_ERR_INVALID_ARGS options is nonzero, or out is an invalid pointer.
MX_ERR_ACCESS_DENIED job does not have the MX_RIGHT_WRITE right.
MX_ERR_OUT_OF_RANGE job has a MX_PROP_JOB_MAX_HEIGHT property value of zero.
MX_ERR_NO_MEMORY (Temporary) Failure due to lack of memory.
MX_ERR_BAD_STATE (Temporary) Failure due to the job object being in the middle of a mx_task_kill() operation.