Records

Functions

  • bool ReinterpretBytesImpl (const char * from, size_t from_size, char * to, size_t to_size)
  • template <class T>
    const MemorySnapshot * MergeWithOtherSnapshotImpl (const T * self, const MemorySnapshot * other)
  • bool ReadExactly (std::function<FileOperationResult (bool, void *, size_t)> read_function, bool can_log, void * buffer, size_t size)

    The internal implementation of ReadFileExactly() and its wrappers.

    The logic is exposed so that it may be reused by FileReaderInterface, and

    so that it may be tested without requiring large files to be read. It is not

    intended to be used more generally. Use ReadFileExactly(),

    LoggingReadFileExactly(), CheckedReadFileExactly(), or

    FileReaderInterface::ReadExactly() instead.

  • FileOperationResult NativeWriteFile (FileHandle fileconst void * buffersize_t size)

    Writes to a file, retrying when interrupted on POSIX.

    Fewer than

    bytes may be written to

    This can happen if the

    underlying write operation returns before writing the entire buffer, or if

    the buffer is too large to write in a single operation, possibly due to a

    limitation of a data type used to express the number of bytes written.

    This function adapts native write operations for uniform use by WriteFile().

    This function should only be called by WriteFile(). Other code should call

    WriteFile() or another function that wraps WriteFile().

    Parameters

    file [in] The file to write to.
    buffer [in] A buffer containing data to be written.
    size [in] The number of bytes from to write.

    Returns

    The number of bytes actually written from

    to

    on

    success. `-1` on error, with `errno` or `GetLastError()` set

    appropriately.