aboutsummaryrefslogtreecommitdiff
path: root/sysdeps/unix/sysv/linux/preadv.c
diff options
context:
space:
mode:
Diffstat (limited to 'sysdeps/unix/sysv/linux/preadv.c')
-rw-r--r--sysdeps/unix/sysv/linux/preadv.c17
1 files changed, 13 insertions, 4 deletions
diff --git a/sysdeps/unix/sysv/linux/preadv.c b/sysdeps/unix/sysv/linux/preadv.c
index ff9af6fa05..8c89d9200e 100644
--- a/sysdeps/unix/sysv/linux/preadv.c
+++ b/sysdeps/unix/sysv/linux/preadv.c
@@ -29,6 +29,13 @@
#include <sys/syscall.h>
#include <kernel-features.h>
+#ifdef __x86_64__
+#define __NR_preadv 295
+#elif defined __i386__
+#define __NR_preadv 333
+#endif
+
+
#ifndef PREADV
# define PREADV preadv
# define PREADV_REPLACEMENT __atomic_preadv_replacement
@@ -53,14 +60,16 @@ PREADV (fd, vector, count, offset)
ssize_t result;
if (SINGLE_THREAD_P)
- result = INLINE_SYSCALL (preadv, 5, fd, vector, count, offset >> 32,
- offset & 0xffffffff);
+ result = INLINE_SYSCALL (preadv, 5, fd, vector, count,
+ (off_t) ((off64_t) offset >> 32),
+ (off_t) (offset & 0xffffffff));
else
{
int oldtype = LIBC_CANCEL_ASYNC ();
- result = INLINE_SYSCALL (preadv, 5, fd, vector, count, offset >> 32,
- offset & 0xffffffff);
+ result = INLINE_SYSCALL (preadv, 5, fd, vector, count,
+ (off_t) ((off64_t) offset >> 32),
+ (off_t) (offset & 0xffffffff));
LIBC_CANCEL_RESET (oldtype);
}