1# zx_eventpair_create
2
3## NAME
4
5eventpair_create - create an event pair
6
7## SYNOPSIS
8
9```
10#include <zircon/syscalls.h>
11
12zx_status_t zx_eventpair_create(uint32_t options, zx_handle_t* out0, zx_handle_t* out1);
13```
14
15
16## DESCRIPTION
17
18**eventpair_create**() creates an event pair, which is a pair of objects that
19are mutually signalable.
20
21The signals *ZX_EVENTPAIR_SIGNALED* and *ZX_USER_SIGNAL_n* (where *n* is 0 through 7)
22may be set or cleared using **object_signal**() (modifying the signals on the
23object itself), or **object_signal_peer**() (modifying the signals on its
24counterpart).
25
26When all the handles to one of the objects have been closed, the
27*ZX_EVENTPAIR_PEER_CLOSED* signal will be asserted on the opposing object.
28
29The newly-created handles will have the *ZX_RIGHT_TRANSFER*,
30*ZX_RIGHT_DUPLICATE*, *ZX_RIGHT_READ*, *ZX_RIGHT_WRITE*, *ZX_RIGHT_SIGNAL*,
31and *ZX_RIGHT_SIGNAL_PEER* rights.
32
33Currently, no options are supported, so *options* must be set to 0.
34
35
36## RIGHTS
37
38TODO(ZX-2399)
39
40## RETURN VALUE
41
42**eventpair_create**() returns **ZX_OK** on success. On failure, a (negative)
43error code is returned.
44
45
46## ERRORS
47
48**ZX_ERR_INVALID_ARGS**  *out0* or *out1* is an invalid pointer or NULL.
49
50**ZX_ERR_NOT_SUPPORTED**  *options* has an unsupported flag set (i.e., is not 0).
51
52**ZX_ERR_NO_MEMORY**  Failure due to lack of memory.
53There is no good way for userspace to handle this (unlikely) error.
54In a future build this error will no longer occur.
55
56
57## SEE ALSO
58
59[event_create](event_create.md),
60[handle_close](handle_close.md),
61[handle_duplicate](handle_duplicate.md),
62[object_wait_one](object_wait_one.md),
63[object_wait_many](object_wait_many.md),
64[handle_replace](handle_replace.md),
65[object_signal](object_signal.md),
66[object_signal_peer](object_signal.md).
67