class UnbufferedPseudoFile
Defined at line 180 of file ../../src/storage/lib/vfs/cpp/pseudo_file.h
Unbuffered pseudo-file.
This variant is optimized for atomically reading and writing small properties. Unlike buffered
pseudo-files, it is not necessary to re-open the pseudo-file to observe side-effects; the client
can simply seek back to the zero offset and read or write again.
Because reads and writes are not buffered, the maximum size of the property is limited to what
will fit in a single I/O transaction. Unbuffered pseudo-files generally work best for properties
which are likely to be polled or repeatedly modified and which are no larger than the nominal I/O
buffer size used by the intended clients.
As a conservative guideline, we recommend using |BufferedPseudoFile| instead for content larger
than the system page size.
In read mode, the pseudo-file invokes its read handler each time |Read()| is called with a seek
offset of 0, returning at most as many bytes as the client requested and discarding the remainder
(if any).
Reading with a non-zero seek offset returns empty data, indicating end of file.
In write mode, the pseudo-file invokes its write handler each time |Write()| with a seek offset
of 0 is called, passing all of the bytes written by the client as the input string. Likewise,
|Append()| invokes the write handler each time it is called and returns a new end of file offset
of 0.
Writing with a non-zero seek offset returns |ZX_ERR_NO_SPACE|, indicating an attempt to write
data beyond what was accepted by the write handler.
Truncating the length to zero and then closing it without an intervening write is equivalent to
writing 0 bytes. Truncating to a non-zero length returns |ZX_ERR_INVALID_ARGS|.
This class is thread-safe.
Friends
class RefPtr
class MakeRefCountedHelper