folly::fileutil_detail::wrapFull

Wrap call to read/pread/write/pwrite(fd, buf, count, offset?) to retry on incomplete reads / writes. The variadic argument magic is there to support an additional argument (offset) for pread / pwrite; see the incr() functions above which do nothing if the offset is not present and increment it if it is.

Synopsis

Declared in <folly/detail/FileUtilDetail.h>

template<
    class F,
    class... Offset>
ssize_t
wrapFull(
    F f,
    int fd,
    void* buf,
    size_t count,
    Offset... offset);

Return Value

The total number of bytes transferred, or -1 on error.

Parameters

NameDescription
fThe read/write function to invoke.
fdThe file descriptor to operate on.
bufThe buffer to read into or write from.
countThe number of bytes to transfer.
offsetOptional file offset for positional variants.