1# zx_task_resume_from_exception 2 3## NAME 4 5<!-- Updated by update-docs-from-abigen, do not edit. --> 6 7task_resume_from_exception - resume the given task after an exception has been reported 8 9## SYNOPSIS 10 11<!-- Updated by update-docs-from-abigen, do not edit. --> 12 13``` 14#include <zircon/syscalls.h> 15 16zx_status_t zx_task_resume_from_exception(zx_handle_t handle, 17 zx_handle_t port, 18 uint32_t options); 19``` 20 21## DESCRIPTION 22 23`zx_task_resume_from_exception()` causes the requested task to resume after an 24exception has been reported to the debug exception port. The port parameter 25should identify the [exception port](task_bind_exception_port.md) to which the 26exception being resumed from was delivered. 27 28Note that if a thread has any open [suspend tokens](task_suspend_token.md), it 29will remain suspended even when resumed from an exception. 30 31There are two ways to resume from an exception, depending on whether 32one wants the thread to resume where it left off, which in the case 33of an architectural exception generally means retrying the offending 34instruction, or give the next handler in the search order a chance 35to handle the exception. 36See [`zx_task_bind_exception_port()`] for a description of exception processing. 37 38To resume a thread where it left off, pass 0 for the options: 39 40``` 41zx_status_t status = zx_task_resume_from_exception(thread, port, 0); 42``` 43 44To pass the exception on to the next handler in the search order, 45pass **ZX_RESUME_TRY_NEXT** for the options. 46 47``` 48zx_status_t status = zx_task_resume_from_exception(thread, port, ZX_RESUME_TRY_NEXT); 49``` 50 51## RIGHTS 52 53<!-- Updated by update-docs-from-abigen, do not edit. --> 54 55*handle* must be of type **ZX_OBJ_TYPE_THREAD**. 56 57*port* must be of type **ZX_OBJ_TYPE_PORT**. 58 59## RETURN VALUE 60 61`zx_task_resume_from_exception()` returns **ZX_OK** on success. 62In the event of failure, a negative error value is returned. 63 64## ERRORS 65 66**ZX_ERR_ACCESS_DENIED** *port* is not the port from which the exception 67report was sent. 68 69**ZX_ERR_BAD_HANDLE** Either *handle* or *port* is not a valid handle. 70 71**ZX_ERR_WRONG_TYPE** Either *handle* is not a thread handle, 72or *port* is not a port handle. 73 74**ZX_ERR_BAD_STATE** The task is not in a state where resuming is possible, 75for example, it is dead or there is not an exception to resume from. 76 77**ZX_ERR_INVALID_ARGS** *options* is not valid. 78 79## LIMITATIONS 80 81Currently only thread handles are supported. 82 83## SEE ALSO 84 85 - [`zx_task_bind_exception_port()`] 86 87<!-- References updated by update-docs-from-abigen, do not edit. --> 88 89[`zx_task_bind_exception_port()`]: task_bind_exception_port.md 90