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.
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);
The total number of bytes transferred, or -1 on error.
| Name | Description |
|---|---|
| f | The read/write function to invoke. |
| fd | The file descriptor to operate on. |
| buf | The buffer to read into or write from. |
| count | The number of bytes to transfer. |
| offset | Optional file offset for positional variants. |