Next: , Previous: Task Creation, Up: Task Interface


7.2.2 Task Termination

— Function: kern_return_t task_terminate (task_t target_task)

The function task_terminate destroys the task specified by target_task and all its threads. All resources that are used only by this task are freed. Any port to which this task has receive and ownership rights is destroyed.

The function returns KERN_SUCCESS if the task has been killed, KERN_INVALID_ARGUMENT if target_task is not a task.