aboutsummaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorJinhui huang <huangjh.jy@cn.fujitsu.com>2019-03-01 15:16:27 +0800
committerXiao Yang <yangx.jy@cn.fujitsu.com>2019-03-05 11:11:00 +0800
commit1ad03f5fd8a229994f611221d7f9d2c39af19562 (patch)
treee655e8be75ca7820ce4d019ad9e55019f8537c1b /include
parent255dc8c0e37bbef97c0cdc433e0e4654778edd98 (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.h26
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 */