1# zx_channel_create
2
3## NAME
4
5<!-- Updated by update-docs-from-abigen, do not edit. -->
6
7channel_create - create a channel
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_channel_create(uint32_t options,
17                              zx_handle_t* out0,
18                              zx_handle_t* out1);
19```
20
21## DESCRIPTION
22
23`zx_channel_create()` creates a channel, a bi-directional
24datagram-style message transport capable of sending raw data bytes
25as well as handles from one side to the other.
26
27Two handles are returned on success, providing access to both sides
28of the channel.  Messages written to one handle may be read from
29the opposite.
30
31The handles will have **ZX_RIGHT_TRANSFER** (allowing them to be sent
32to another process via channel write), **ZX_RIGHT_WRITE** (allowing
33messages to be written to them), and **ZX_RIGHT_READ** (allowing messages
34to be read from them).
35
36
37## RIGHTS
38
39<!-- Updated by update-docs-from-abigen, do not edit. -->
40
41TODO(ZX-2399)
42
43## RETURN VALUE
44
45`zx_channel_create()` returns **ZX_OK** on success. In the event
46of failure, a negative error value is returned.
47
48## ERRORS
49
50**ZX_ERR_INVALID_ARGS**  *out0* or *out1* is an invalid pointer or NULL or
51*options* is any value other than 0.
52
53**ZX_ERR_NO_MEMORY**  Failure due to lack of memory.
54There is no good way for userspace to handle this (unlikely) error.
55In a future build this error will no longer occur.
56
57## SEE ALSO
58
59 - [`zx_channel_call()`]
60 - [`zx_channel_read()`]
61 - [`zx_channel_write()`]
62 - [`zx_handle_close()`]
63 - [`zx_handle_duplicate()`]
64 - [`zx_handle_replace()`]
65 - [`zx_object_wait_async()`]
66 - [`zx_object_wait_many()`]
67 - [`zx_object_wait_one()`]
68
69<!-- References updated by update-docs-from-abigen, do not edit. -->
70
71[`zx_channel_call()`]: channel_call.md
72[`zx_channel_read()`]: channel_read.md
73[`zx_channel_write()`]: channel_write.md
74[`zx_handle_close()`]: handle_close.md
75[`zx_handle_duplicate()`]: handle_duplicate.md
76[`zx_handle_replace()`]: handle_replace.md
77[`zx_object_wait_async()`]: object_wait_async.md
78[`zx_object_wait_many()`]: object_wait_many.md
79[`zx_object_wait_one()`]: object_wait_one.md
80