12 #if defined(HAVE_PREADV) && defined(HAVE_PWRITEV)
13 const off_t offset = 0xdefaceddeadbeefLL;
16 struct iovec iov = { buf, sizeof buf };
18 assert((fd = open("/dev/zero", O_RDONLY)) >= 0);
19 assert(pread(fd, buf, sizeof buf, offset) == 4);
20 assert(preadv(fd, &iov, 1, offset) == 4);
23 assert((fd = open("/dev/null", O_WRONLY)) >= 0);
24 assert(pwrite(fd, buf, sizeof buf, offset) == 4);
25 assert(pwritev(fd, &iov, 1, offset) == 4);