deleted file mode 100644
@@ -1,26 +0,0 @@
-// 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 LAPI_PWRITEV2_H__
-#define LAPI_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)
-
-static inline 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 /* LAPI_PWRITEV2_H__ */
similarity index 51%
rename from include/lapi/preadv2.h
rename to include/lapi/uio.h
@@ -14,11 +14,27 @@
# define RWF_NOWAIT 0x00000008
#endif
-#if !defined(HAVE_PREADV2)
/* LO_HI_LONG taken from glibc */
# define LO_HI_LONG(val) (long) (val), (long) (((uint64_t) (val)) >> 32)
+#if !defined(HAVE_PREADV)
+static inline ssize_t preadv(int fd, const struct iovec *iov, int iovcnt,
+ off_t offset)
+{
+ return tst_syscall(__NR_preadv, fd, iov, iovcnt, LO_HI_LONG(offset));
+}
+#endif
+
+#if !defined(HAVE_PWRITEV)
+static inline ssize_t pwritev(int fd, const struct iovec *iov, int iovcnt,
+ off_t offset)
+{
+ return tst_syscall(__NR_pwritev, fd, iov, iovcnt, LO_HI_LONG(offset));
+}
+#endif
+
+#if !defined(HAVE_PREADV2)
static inline ssize_t preadv2(int fd, const struct iovec *iov, int iovcnt,
off_t offset, int flags)
{
@@ -27,4 +43,15 @@ static inline ssize_t preadv2(int fd, const struct iovec *iov, int iovcnt,
}
#endif
+#if !defined(HAVE_PWRITEV2)
+static inline 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
+
+#undef LO_HI_LONG
+
#endif /* LAPI_PREADV2_H__ */
deleted file mode 100644
@@ -1,22 +0,0 @@
-/* SPDX-License-Identifier: GPL-2.0-or-later
- *
- * Copyright (c) 2015 Fujitsu Ltd.
- * Author: Xiao Yang <yangx.jy@cn.fujitsu.com>
- * Copyright (c) Linux Test Project, 2016-2023
- */
-
-#ifndef PREADV_H
-#define PREADV_H
-
-#include <sys/types.h>
-#include "config.h"
-#include "lapi/syscalls.h"
-
-#if !defined(HAVE_PREADV)
-int preadv(int fd, const struct iovec *iov, int iovcnt, off_t offset)
-{
- return tst_syscall(__NR_preadv, fd, iov, iovcnt, offset);
-}
-#endif
-
-#endif /* RREADV_H */
@@ -20,7 +20,7 @@
#include <sys/uio.h>
#include "tst_test.h"
-#include "preadv.h"
+#include "lapi/uio.h"
#define CHUNK 64
@@ -23,7 +23,7 @@
#include <sys/uio.h>
#include <unistd.h>
#include "tst_test.h"
-#include "preadv.h"
+#include "lapi/uio.h"
#define CHUNK 64
@@ -22,7 +22,7 @@
#include <sys/ioctl.h>
#include <sys/mount.h>
#include "tst_test.h"
-#include "preadv.h"
+#include "lapi/uio.h"
#define MNTPOINT "mntpoint"
#define FNAME MNTPOINT"/file"
@@ -20,7 +20,7 @@
#include <sys/uio.h>
#include "tst_test.h"
-#include "lapi/preadv2.h"
+#include "lapi/uio.h"
#define CHUNK 64
@@ -25,7 +25,7 @@
#include <unistd.h>
#include "tst_test.h"
-#include "lapi/preadv2.h"
+#include "lapi/uio.h"
#define CHUNK 64
@@ -45,7 +45,7 @@
#include "tst_test.h"
#include "tst_safe_pthread.h"
-#include "lapi/preadv2.h"
+#include "lapi/uio.h"
#define CHUNK_SZ 4123
#define CHUNKS 60
deleted file mode 100644
@@ -1,22 +0,0 @@
-/* SPDX-License-Identifier: GPL-2.0-or-later
- *
- * Copyright (c) 2015 Fujitsu Ltd.
- * Author: Xiao Yang <yangx.jy@cn.fujitsu.com>
- * Copyright (c) Linux Test Project, 2016-2023
- */
-
-#ifndef PWRITEV_H
-#define PWRITEV_H
-
-#include <sys/types.h>
-#include "config.h"
-#include "lapi/syscalls.h"
-
-#if !defined(HAVE_PWRITEV)
-int pwritev(int fd, const struct iovec *iov, int iovcnt, off_t offset)
-{
- return tst_syscall(__NR_pwritev, fd, iov, iovcnt, offset);
-}
-#endif
-
-#endif /* PWRITEV_H */
@@ -18,7 +18,7 @@
#include <string.h>
#include <sys/uio.h>
#include "tst_test.h"
-#include "pwritev.h"
+#include "lapi/uio.h"
#include "tst_safe_prw.h"
#define CHUNK 64
@@ -22,7 +22,7 @@
#include <sys/uio.h>
#include <unistd.h>
#include "tst_test.h"
-#include "pwritev.h"
+#include "lapi/uio.h"
#define CHUNK 64
@@ -22,7 +22,7 @@
#include <sys/ioctl.h>
#include <sys/mount.h>
#include "tst_test.h"
-#include "pwritev.h"
+#include "lapi/uio.h"
#include "tst_safe_prw.h"
#define MNTPOINT "mntpoint"
@@ -22,7 +22,7 @@
#include <sys/uio.h>
#include "tst_test.h"
-#include "lapi/pwritev2.h"
+#include "lapi/uio.h"
#include "tst_safe_prw.h"
#define CHUNK 64
@@ -26,7 +26,7 @@
#include <unistd.h>
#include "tst_test.h"
-#include "lapi/pwritev2.h"
+#include "lapi/uio.h"
#define CHUNK 64
Merge existing LAPI definitions of preadv2()/pwritev2() to lapi/uio.h and add preadv()/pwritev() definitions from test code. Also fix minor bugs in return value type and offset handling. Signed-off-by: Martin Doucha <mdoucha@suse.cz> --- include/lapi/pwritev2.h | 26 ----------------- include/lapi/{preadv2.h => uio.h} | 29 ++++++++++++++++++- testcases/kernel/syscalls/preadv/preadv.h | 22 -------------- testcases/kernel/syscalls/preadv/preadv01.c | 2 +- testcases/kernel/syscalls/preadv/preadv02.c | 2 +- testcases/kernel/syscalls/preadv/preadv03.c | 2 +- testcases/kernel/syscalls/preadv2/preadv201.c | 2 +- testcases/kernel/syscalls/preadv2/preadv202.c | 2 +- testcases/kernel/syscalls/preadv2/preadv203.c | 2 +- testcases/kernel/syscalls/pwritev/pwritev.h | 22 -------------- testcases/kernel/syscalls/pwritev/pwritev01.c | 2 +- testcases/kernel/syscalls/pwritev/pwritev02.c | 2 +- testcases/kernel/syscalls/pwritev/pwritev03.c | 2 +- .../kernel/syscalls/pwritev2/pwritev201.c | 2 +- .../kernel/syscalls/pwritev2/pwritev202.c | 2 +- 15 files changed, 39 insertions(+), 82 deletions(-) delete mode 100644 include/lapi/pwritev2.h rename include/lapi/{preadv2.h => uio.h} (51%) delete mode 100644 testcases/kernel/syscalls/preadv/preadv.h delete mode 100644 testcases/kernel/syscalls/pwritev/pwritev.h