Create a stream from a VMO.
#include <zircon/syscalls.h> zx_status_t zx_stream_create(uint32_t options, zx_handle_t vmo, uint64_t seek, zx_handle_t* out_stream);
zx_stream_create() creates a stream, which reads and writes the data in an
The seek offset for the stream is initialized to seek.
ZX_STREAM_MODE_READ The stream will be used for reading. If the given vmo lacks ZX_RIGHT_READ, this function will return ZX_ERR_ACCESS_DENIED. Otherwise, ZX_RIGHT_READ will be included as a right on the created stream object.
ZX_STREAM_MODE_WRITE The stream will be used for writing. If the given vmo lacks ZX_RIGHT_WRITE, this function will return ZX_ERR_ACCESS_DENIED. Otherwise, ZX_RIGHT_WRITE will be included as a right on the created stream object.
ZX_STREAM_MODE_APPEND The stream is in append mode. See
zx_stream_writev() for the effect of this option.
zx_stream_create() returns ZX_OK on success. In the event of
failure, one of the following values is returned.
ZX_ERR_BAD_HANDLE vmo is not a valid handle.
ZX_ERR_WRONG_TYPE vmo is not a VMO handle.
ZX_ERR_ACCESS_DENIED vmo does not have the rights required for the given options.
ZX_ERR_INVALID_ARGS out_stream is an invalid pointer or NULL, options has an unsupported bit set to 1.
ZX_ERR_NO_MEMORY Failure due to lack of memory.
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2020-01-30.