# zx_event_create

## Summary

Create an event.

## Declaration

    #include <zircon/syscalls.h>

    zx_status_t zx_event_create(uint32_t options, zx_handle_t* out);

## Description

`zx_event_create()` creates an event, which is an object that is signalable. That
is, the signals `ZX_EVENT_SIGNALED` and `ZX_USER_SIGNAL_n` (where *n* is 0 through
7) can be manipulated using [`zx_object_signal()`](https://fuchsia.dev/reference/syscalls/object_signal).

The newly-created handle will have the [basic
rights](https://fuchsia.dev/docs/concepts/kernel/rights#zx_rights_basic) plus `ZX_RIGHT_SIGNAL`.

## Rights

Caller job policy must allow `ZX_POL_NEW_EVENT`.

## Return value

`zx_event_create()` returns `ZX_OK` and a valid event handle (via *out*) on success.
On failure, an error value is returned.

## Errors

`ZX_ERR_INVALID_ARGS` *out* is an invalid pointer, or *options* is nonzero.

`ZX_ERR_NO_MEMORY` Failure due to lack of memory.
There is no good way for userspace to handle this (unlikely) error.
In a future build this error will no longer occur.

## See also

- [`zx_eventpair_create()`](https://fuchsia.dev/reference/syscalls/eventpair_create)
- [`zx_handle_close()`](https://fuchsia.dev/reference/syscalls/handle_close)
- [`zx_handle_duplicate()`](https://fuchsia.dev/reference/syscalls/handle_duplicate)
- [`zx_handle_replace()`](https://fuchsia.dev/reference/syscalls/handle_replace)
- [`zx_object_signal()`](https://fuchsia.dev/reference/syscalls/object_signal)
- [`zx_object_wait_async()`](https://fuchsia.dev/reference/syscalls/object_wait_async)
- [`zx_object_wait_many()`](https://fuchsia.dev/reference/syscalls/object_wait_many)
- [`zx_object_wait_one()`](https://fuchsia.dev/reference/syscalls/object_wait_one)