1# zx_eventpair_create
2
3## NAME
4
5<!-- Updated by update-docs-from-abigen, do not edit. -->
6
7eventpair_create - create an event pair
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_eventpair_create(uint32_t options,
17                                zx_handle_t* out0,
18                                zx_handle_t* out1);
19```
20
21## DESCRIPTION
22
23`zx_eventpair_create()` creates an event pair, which is a pair of objects that
24are mutually signalable.
25
26The signals **ZX_EVENTPAIR_SIGNALED** and **ZX_USER_SIGNAL_n** (where *n* is 0 through 7)
27may be set or cleared using [`zx_object_signal()`] (modifying the signals on the
28object itself), or [`zx_object_signal_peer()`] (modifying the signals on its
29counterpart).
30
31When all the handles to one of the objects have been closed, the
32**ZX_EVENTPAIR_PEER_CLOSED** signal will be asserted on the opposing object.
33
34The newly-created handles will have the **ZX_RIGHT_TRANSFER**,
35**ZX_RIGHT_DUPLICATE**, **ZX_RIGHT_READ**, **ZX_RIGHT_WRITE**, **ZX_RIGHT_SIGNAL**,
36and **ZX_RIGHT_SIGNAL_PEER** rights.
37
38Currently, no options are supported, so *options* must be set to 0.
39
40
41## RIGHTS
42
43<!-- Updated by update-docs-from-abigen, do not edit. -->
44
45TODO(ZX-2399)
46
47## RETURN VALUE
48
49`zx_eventpair_create()` returns **ZX_OK** on success. On failure, a (negative)
50error code is returned.
51
52
53## ERRORS
54
55**ZX_ERR_INVALID_ARGS**  *out0* or *out1* is an invalid pointer or NULL.
56
57**ZX_ERR_NOT_SUPPORTED**  *options* has an unsupported flag set (i.e., is not 0).
58
59**ZX_ERR_NO_MEMORY**  Failure due to lack of memory.
60There is no good way for userspace to handle this (unlikely) error.
61In a future build this error will no longer occur.
62
63
64## SEE ALSO
65
66 - [`zx_event_create()`]
67 - [`zx_handle_close()`]
68 - [`zx_handle_duplicate()`]
69 - [`zx_handle_replace()`]
70 - [`zx_object_signal()`]
71 - [`zx_object_signal_peer()`]
72 - [`zx_object_wait_async()`]
73 - [`zx_object_wait_many()`]
74 - [`zx_object_wait_one()`]
75
76<!-- References updated by update-docs-from-abigen, do not edit. -->
77
78[`zx_event_create()`]: event_create.md
79[`zx_handle_close()`]: handle_close.md
80[`zx_handle_duplicate()`]: handle_duplicate.md
81[`zx_handle_replace()`]: handle_replace.md
82[`zx_object_signal()`]: object_signal.md
83[`zx_object_signal_peer()`]: object_signal_peer.md
84[`zx_object_wait_async()`]: object_wait_async.md
85[`zx_object_wait_many()`]: object_wait_many.md
86[`zx_object_wait_one()`]: object_wait_one.md
87