2 * Copyright (c) 2014-2016 Dmitry V. Levin <ldv@altlinux.org>
3 * Copyright (c) 2014-2018 The strace developers.
6 * SPDX-License-Identifier: GPL-2.0-or-later
11 #if defined(HAVE_PREADV) && defined(HAVE_PWRITEV)
21 const off_t offset = 0xdefaceddeadbeefLL;
23 struct iovec iov = { buf, sizeof(buf) };
26 assert(open("/dev/zero", O_RDONLY) == 0);
27 assert(pread(0, buf, sizeof(buf), offset) == 4);
28 assert(preadv(0, &iov, 1, offset) == 4);
31 assert(open("/dev/null", O_WRONLY) == 0);
32 assert(pwrite(0, buf, sizeof(buf), offset) == 4);
33 assert(pwritev(0, &iov, 1, offset) == 4);
41 SKIP_MAIN_UNDEFINED("HAVE_PREADV && HAVE_PWRITEV")