zx_stream_readv_at

NAME

Read data from a stream at the given offset.

SYNOPSIS

#include <zircon/syscalls.h>

zx_status_t zx_stream_readv_at(zx_handle_t handle,
                               uint32_t options,
                               uint64_t offset,
                               zx_iovec_t* vector,
                               size_t num_vector,
                               size_t* actual);

DESCRIPTION

zx_stream_readv_at() attempts to read bytes from the stream, starting at the given offset, into the buffers specified by vector and num_vector. If successful, the number of bytes actually read are return via actual.

If the given offset is beyond the end of the stream, zx_stream_readv_at() will succeed in reading zero bytes.

If a NULL actual is passed in, it will be ignored.

Does not advance the seek offset of the stream.

If the contents of vector change during this operation, if any of the buffers overlap, or if any of the buffers overlap vector, the behavior is unspecified.

options is reserved for future use and must be 0.

RIGHTS

handle must be of type ZX_OBJ_TYPE_STREAM and have ZX_RIGHT_READ.

RETURN VALUE

zx_stream_readv_at() returns ZX_OK on success, and writes into actual (if non-NULL) the exact number of bytes read.

ERRORS

ZX_ERR_BAD_HANDLE handle is not a valid handle.

ZX_ERR_WRONG_TYPE handle is not a stream handle.

ZX_ERR_ACCESS_DENIED handle does not have the ZX_RIGHT_READ right.

ZX_ERR_INVALID_ARGS vector is an invalid zx_iovec_t.

ZX_ERR_NOT_FOUND the vector address, or an address specified within vector does not map to address in address space.

ZX_ERR_BAD_STATE the underlying data source cannot be read.

SEE ALSO