Next: Task Termination, Up: Task Interface
The function
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 (seevm_inherit
). The child task initially contains no threads.If inherit_memory is 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.
The child task gets the three 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. TheTASK_BOOTSTRAP_PORT
and theTASK_EXCEPTION_PORT
are inherited from the parent task. The new task can get send rights to these ports with the calltask_get_special_port
.The function returns
KERN_SUCCESS
if a new task has been created,KERN_INVALID_ARGUMENT
if parent_task is not a valid task port andKERN_RESOURCE_SHORTAGE
if some critical kernel resource is unavailable.