ΒΆExpected<size_t> readNativeFile(
    llvm::sys::fs::file_t FileHandle,
    MutableArrayRef<char> Buf)

Description

Reads \p Buf.size() bytes from \p FileHandle into \p Buf. Returns the number of bytes actually read. On Unix, this is equivalent to `return ::read(FD, Buf.data(), Buf.size())`, with error reporting. Returns 0 when reaching EOF.

Declared at: llvm/include/llvm/Support/FileSystem.h:1001

Parameters

llvm::sys::fs::file_t FileHandle
File to read from.
MutableArrayRef<char> Buf
Buffer to read into.

Returns

The number of bytes read, or error.