]> git.sesse.net Git - plocate/blob - complete_pread.h
Release plocate 1.1.22.
[plocate] / complete_pread.h
1 #ifndef COMPLETE_PREAD_H
2 #define COMPLETE_PREAD_H 1
3
4 #include <unistd.h>
5
6 // A wrapper around pread() that retries on short reads and EINTR,
7 // so you never need to call it twice. Always synchronous (no io_uring).
8 bool try_complete_pread(int fd, void *ptr, size_t len, off_t offset);
9
10 // Same, but exit on failure, so never returns a short read.
11 void complete_pread(int fd, void *ptr, size_t len, off_t offset);
12
13 #endif  // !defined(COMPLETE_PREAD_H)