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

Description

Reads \p Buf.size() bytes from \p FileHandle at offset \p Offset into \p Buf. If 'pread' is available, this will use that, otherwise it will use 'lseek'. Returns the number of bytes actually read. Returns 0 when reaching EOF.

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

Parameters

llvm::sys::fs::file_t FileHandle
File to read from.
MutableArrayRef<char> Buf
Buffer to read into.
uint64_t Offset
Offset into the file at which the read should occur.

Returns

The number of bytes read, or error.