37 #define PG_IOV_MAX Min(IOV_MAX, 32)
44 pg_preadv(
int fd,
const struct iovec *iov,
int iovcnt, off_t offset)
52 return pread(
fd, iov[0].iov_base, iov[0].iov_len, offset);
54 return preadv(
fd, iov, iovcnt, offset);
59 for (
int i = 0;
i < iovcnt; ++
i)
61 part =
pg_pread(
fd, iov[
i].iov_base, iov[
i].iov_len, offset);
71 if (part < iov[
i].iov_len)
83 pg_pwritev(
int fd,
const struct iovec *iov,
int iovcnt, off_t offset)
91 return pwrite(
fd, iov[0].iov_base, iov[0].iov_len, offset);
93 return pwritev(
fd, iov, iovcnt, offset);
98 for (
int i = 0;
i < iovcnt; ++
i)
100 part =
pg_pwrite(
fd, iov[
i].iov_base, iov[
i].iov_len, offset);
110 if (part < iov[
i].iov_len)
static ssize_t pg_pwritev(int fd, const struct iovec *iov, int iovcnt, off_t offset)
static ssize_t pg_preadv(int fd, const struct iovec *iov, int iovcnt, off_t offset)
static int fd(const char *x, int i)