diff options
author | Jinhui huang <huangjh.jy@cn.fujitsu.com> | 2019-03-01 15:16:27 +0800 |
---|---|---|
committer | Xiao Yang <yangx.jy@cn.fujitsu.com> | 2019-03-05 11:11:00 +0800 |
commit | 1ad03f5fd8a229994f611221d7f9d2c39af19562 (patch) | |
tree | e655e8be75ca7820ce4d019ad9e55019f8537c1b /include | |
parent | 255dc8c0e37bbef97c0cdc433e0e4654778edd98 (diff) |
syscalls/pwritev201: Add new testcase
Check the basic functionality of the pwritev2().
Signed-off-by: Jinhui huang <huangjh.jy@cn.fujitsu.com>
Reviewed-by: Xiao Yang <yangx.jy@cn.fujitsu.com>
Diffstat (limited to 'include')
-rw-r--r-- | include/lapi/pwritev2.h | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/include/lapi/pwritev2.h b/include/lapi/pwritev2.h new file mode 100644 index 000000000..305e48e02 --- /dev/null +++ b/include/lapi/pwritev2.h @@ -0,0 +1,26 @@ +// SPDX-License-Identifier: GPL-2.0-or-later +/* + * Copyright (c) 2019 FUJITSU LIMITED. All rights reserved. + * Author: Jinhui Huang <huangjh.jy@cn.fujitsu.com> + */ + +#ifndef PWRITEV2_H +#define PWRITEV2_H + +#include "config.h" +#include "lapi/syscalls.h" + +#if !defined(HAVE_PWRITEV2) + +/* LO_HI_LONG taken from glibc */ +# define LO_HI_LONG(val) (long) (val), (long) (((uint64_t) (val)) >> 32) + +ssize_t pwritev2(int fd, const struct iovec *iov, int iovcnt, off_t offset, + int flags) +{ + return tst_syscall(__NR_pwritev2, fd, iov, iovcnt, + LO_HI_LONG(offset), flags); +} +#endif + +#endif /* PWRITEV2_H */ |