summaryrefslogtreecommitdiff
path: root/libc/sysdeps/linux/common/pwritev.c
diff options
context:
space:
mode:
authorGuo Ren <ren_guo@c-sky.com>2017-09-25 21:15:04 +0800
committerWaldemar Brodkorb <wbx@uclibc-ng.org>2017-10-01 08:54:13 +0200
commit8b233f2491b286a2bd741b042719fdf5fde50eb2 (patch)
tree1399ccbb0ee451aecd9b9659f0266b7b95ca86de /libc/sysdeps/linux/common/pwritev.c
parent2a3bb4daf5778c5875674cd26a3c75b3d460a042 (diff)
preadv/pwritev: bugfix preadv/pwritev syscall should be 5 args
The current uclibc-ng use 4 arguments, and this will cause ltp-testsuite's preadv/pwritev case failed. The syscall of preadv/pwritev in current linux-kernel is 5 arguments: linux/fs/read_write.c: SYSCALL_DEFINE5(preadv, unsigned long, fd, const struct iovec __user *, vec, unsigned long, vlen, unsigned long, pos_l, unsigned long, pos_h) SYSCALL_DEFINE5(pwritev, unsigned long, fd, const struct iovec __user *, vec, unsigned long, vlen, unsigned long, pos_l, unsigned long, pos_h) So just update to 5-args-syscall, and off_t could be 32bit or 64bit. Signed-off-by: Guo Ren <ren_guo@c-sky.com>
Diffstat (limited to 'libc/sysdeps/linux/common/pwritev.c')
-rw-r--r--libc/sysdeps/linux/common/pwritev.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/libc/sysdeps/linux/common/pwritev.c b/libc/sysdeps/linux/common/pwritev.c
index a1880ed32..bef5bcf69 100644
--- a/libc/sysdeps/linux/common/pwritev.c
+++ b/libc/sysdeps/linux/common/pwritev.c
@@ -23,6 +23,11 @@
ssize_t
pwritev (int fd, const struct iovec *vector, int count, off_t offset)
{
- return INLINE_SYSCALL (pwritev, 4, fd, vector, count, offset);
+ unsigned long pos_l, pos_h;
+
+ pos_h = (unsigned long)((long long)offset >> 32);
+ pos_l = (unsigned long)((long long)offset);
+
+ return INLINE_SYSCALL (pwritev, 5, fd, vector, count, pos_l, pos_h);
}
#endif