task_terminatedestroys 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_SUCCESSif the task has been killed,
KERN_INVALID_ARGUMENTif target_task is not a task.