| 1 | #define _GNU_SOURCE |
| 2 | #include <sys/uio.h> |
| 3 | #include <unistd.h> |
| 4 | #include "syscall.h" |
| 5 | |
| 6 | ssize_t pwritev2(int fd, const struct iovec *iov, int count, off_t ofs, int flags) |
| 7 | { |
| 8 | #ifdef SYS_pwritev |
| 9 | 	if (!flags) { |
| 10 | 		if (ofs==-1) return writev(fd, iov, count); |
| 11 | 		return syscall_cp(SYS_pwritev, fd, iov, count, |
| 12 | 			(long)(ofs), (long)(ofs>>32)); |
| 13 | 	} |
| 14 | #endif |
| 15 | 	return syscall_cp(SYS_pwritev2, fd, iov, count, |
| 16 | 		(long)(ofs), (long)(ofs>>32), flags); |
| 17 | } |