1# zx_task_kill
2
3## NAME
4
5task_kill - Kill the provided task (job, process, or thread).
6
7## SYNOPSIS
8
9```
10#include <zircon/syscalls.h>
11
12zx_status_t zx_task_kill(zx_handle_t handle);
13
14```
15
16## DESCRIPTION
17
18This asynchronously kills the given process, thread or job and its children
19recursively, until the entire task tree rooted at *handle* is dead.
20
21It is possible to wait for the task to be dead via the **ZX_TASK_TERMINATED**
22signal. When the procedure completes, as observed by the signal, the task and
23all its children are considered to be in the dead state and most operations
24will no longer succeed.
25
26## RIGHTS
27
28TODO(ZX-2399)
29
30## RETURN VALUE
31
32On success, **zx_task_kill**() returns **ZX_OK**. If a process or thread uses
33this syscall to kill itself, this syscall does not return.
34
35## NOTES
36
37When using this syscall on a process, the return code for the process
38is -1 as reported by **object_get_info**() via the ZX_INFO_PROCESS topic.
39
40## ERRORS
41
42**ZX_ERR_BAD_HANDLE**  *handle* is not a valid handle.
43
44**ZX_ERR_WRONG_TYPE**  *handle* is not a task handle.
45
46**ZX_ERR_ACCESS_DENIED**  *handle* does not have the **ZX_RIGHT_DESTROY**
47right.
48
49## SEE ALSO
50
51[job_create](job_create.md),
52[process_create](process_create.md).
53