Kill the provided task (job, process, or thread).
#include <zircon/syscalls.h> zx_status_t zx_task_kill(zx_handle_t handle);
This asynchronously kills the given process, thread or job and its children recursively, until the entire task tree rooted at handle is dead.
It is possible to wait for the task to be dead via the ZX_TASK_TERMINATED signal. When the procedure completes, as observed by the signal, the task and all its children are considered to be in the dead state and most operations will no longer succeed.
If handle is a job and the syscall is successful, the job cannot longer be used to create new processes.
When a process or job is killed via this syscall, the
ZX_TASK_RETCODE_SYSCALL_KILL as reported by
the ZX_INFO_PROCESS or ZX_INFO_JOB topic.
Processes and Jobs can also be killed by other agents such as the Job policy with ZX_POL_ACTION_KILL or when the system is running low on memory OOM.
handle must have ZX_RIGHT_DESTROY.
zx_task_kill() returns ZX_OK. If a process or thread uses
this syscall to kill itself, this syscall does not return.
ZX_ERR_BAD_HANDLE handle is not a valid handle.
ZX_ERR_WRONG_TYPE handle is not a task handle.
ZX_ERR_ACCESS_DENIED handle does not have the ZX_RIGHT_DESTROY right.
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2019-11-21.