pub unsafe extern "C" fn fdf_channel_write(
channel: fdf_handle_t,
options: u32,
arena: *mut fdf_arena_t,
data: *mut c_void,
num_bytes: u32,
handles: *mut zx_handle_t,
num_handles: u32,
) -> zx_status_tExpand description
Attempts to write a message to the channel specified by |channel|.
The caller retains ownership of the |arena| reference, which must be destroyed via |fdf_arena_drop_ref|. It is okay to call |fdf_arena_drop_ref| on the arena as soon as the write call returns, as |fdf_arena_write| will take its own reference to the arena, extending the lifetime of the arena is until the data is read.
The pointers |data| and |handles| may be NULL if their respective sizes are zero. |data| and |handles| must be pointers managed by |arena| if they are not NULL. |handles| may be a mix of zircon handles and fdf handles.
Handles with a pending callback registered via |fdf_channel_wait_async| cannot be transferred.
On success, all |num_handles| of the handles in the handles array are attached to the message and will become available to the reader of that message from the opposite end of the channel.
All handles are consumed and are no longer available to the caller, on success or failure.
ยงErrors
ZX_ERR_INVALID_ARGS: |data| or |handles| are not pointers managed by |arena|, or any element in |handles| is not a valid handle, or at least one of |handles| has a pending callback registered via |fdf_channel_wait_async|.
ZX_ERR_NO_MEMORY: Failed due to a lack of memory.
ZX_ERR_PEER_CLOSED: The other side of the channel is closed.
This operation is thread-safe.