NAME
task_create - creates new task from a parent task

SYNOPSIS
#include <mach.h>

kern_return_t task_create(parent_task, inherit_memory, child_task)
task_t parent_task
boolean_t inherit_memory;
task_t *child_task; /* out */

ARGUMENTS
parent_task The task from which the child’s capabilities are
drawn.

inherit_memory If set, the child task’s address space is built from
the parent task according to its memory inheritance
values; otherwise, the child task is given an empty
address space.

child_task The new task.

DESCRIPTION
task_create creates a new task from parent_task; the resulting task
(child_task) acquires shared or copied parts of the parent’s
address space (see vm_inherit). The child task initially contains
no threads.

The child task gets the four special ports created or copied for it
at task creation. The task_kernel_port is created and send rights
for it are given to the child and returned to the caller. The
task_notify_port is created and receive, ownership and send rights
for it are given to the child. The caller has no access to it. The
task_bootstrap_port and the task_exception_port are inherited from
the parent task. The new task can get send rights to these ports
with the call task_get_special_port.

DIAGNOSTICS
KERN_SUCCESS A new task has been created.

KERN_INVALID_ARGUMENT parent_task is not a valid task
port.

KERN_RESOURCE_SHORTAGE Some critical kernel resource is
unavailable.

SEE ALSO
task_terminate(2), task_suspend(2), task_resume(2),
task_special_ports(2), task_threads(2), thread_create(2),
thread_resume(2), vm_inherit(2)

BUGS
Not implemented yet. Use fork.