# zx_interrupt_ack

## Summary

Acknowledge an interrupt and re-arm it.

## Declaration

    #include <zircon/syscalls.h>

    zx_status_t zx_interrupt_ack(zx_handle_t handle);

## Description

`zx_interrupt_ack()` acknowledges a port-bound interrupt object which was previously
triggered, causing it to reset to the untriggered state and be eligible to trigger again,
delivering a packet to the port it is bound to in the process.

If the interrupt object is a physical level-triggered interrupt which is still asserted, or
is an edge or virtual interrupt that has been asserted since it was last triggered, the
interrupt will immediately trigger again delivering a packet to the port it is bound to.

This syscall only operates on interrupts bound to a port. Interrupts being waited upon with
[`zx_interrupt_wait()`](https://fuchsia.dev/reference/syscalls/interrupt_wait) cannot be re-armed with this call -- it happens automatically when
[`zx_interrupt_wait()`](https://fuchsia.dev/reference/syscalls/interrupt_wait) is called again after a previous [`zx_interrupt_wait()`](https://fuchsia.dev/reference/syscalls/interrupt_wait) operation
has been satisfied. Please see (here)[Interrupts#asynchronous-waiting-and-acknowledgement](https://fuchsia.dev/docs/reference/kernel_objects/interrupts#asynchronous-waiting-and-acknowledgement)
for details on how to properly wait for and acknowledge interrupt events when using a
port-bound interrupt object.

## Rights

*handle* must be of type `ZX_OBJ_TYPE_INTERRUPT` and have `ZX_RIGHT_WRITE`.

## Return value

`zx_interrupt_ack()` returns `ZX_OK` on success. In the event
of failure, a negative error value is returned.

## Errors

`ZX_ERR_BAD_HANDLE` *handle* is an invalid handle.

`ZX_ERR_WRONG_TYPE` *handle* is not an interrupt object.

`ZX_ERR_BAD_STATE` *handle* is not bound to a port.

`ZX_ERR_CANCELED` [`zx_interrupt_destroy()`](https://fuchsia.dev/reference/syscalls/interrupt_destroy) was called on *handle*.

`ZX_ERR_ACCESS_DENIED` *handle* lacks `ZX_RIGHT_WRITE`.

## See also

- [Interrupts](https://fuchsia.dev/docs/reference/kernel_objects/interrupts)
- [`zx_handle_close()`](https://fuchsia.dev/reference/syscalls/handle_close)
- [`zx_interrupt_bind()`](https://fuchsia.dev/reference/syscalls/interrupt_bind)
- [`zx_interrupt_create()`](https://fuchsia.dev/reference/syscalls/interrupt_create)
- [`zx_interrupt_destroy()`](https://fuchsia.dev/reference/syscalls/interrupt_destroy)
- [`zx_interrupt_trigger()`](https://fuchsia.dev/reference/syscalls/interrupt_trigger)
- [`zx_interrupt_wait()`](https://fuchsia.dev/reference/syscalls/interrupt_wait)
- [`zx_port_wait()`](https://fuchsia.dev/reference/syscalls/port_wait)