1570af302Sopenharmony_ci#define _GNU_SOURCE 2570af302Sopenharmony_ci#include <sys/uio.h> 3570af302Sopenharmony_ci#include <unistd.h> 4570af302Sopenharmony_ci#include "syscall.h" 5570af302Sopenharmony_ci 6570af302Sopenharmony_cissize_t preadv2(int fd, const struct iovec *iov, int count, off_t ofs, int flags) 7570af302Sopenharmony_ci{ 8570af302Sopenharmony_ci#ifdef SYS_preadv 9570af302Sopenharmony_ci if (!flags) { 10570af302Sopenharmony_ci if (ofs==-1) return readv(fd, iov, count); 11570af302Sopenharmony_ci return syscall_cp(SYS_preadv, fd, iov, count, 12570af302Sopenharmony_ci (long)(ofs), (long)(ofs>>32)); 13570af302Sopenharmony_ci } 14570af302Sopenharmony_ci#endif 15570af302Sopenharmony_ci return syscall_cp(SYS_preadv2, fd, iov, count, 16570af302Sopenharmony_ci (long)(ofs), (long)(ofs>>32), flags); 17570af302Sopenharmony_ci} 18