summaryrefslogtreecommitdiff
path: root/sysdeps/unix
diff options
context:
space:
mode:
Diffstat (limited to 'sysdeps/unix')
-rw-r--r--sysdeps/unix/sysv/linux/kernel-features.h3
-rw-r--r--sysdeps/unix/sysv/linux/preadv.c13
-rw-r--r--sysdeps/unix/sysv/linux/pwritev.c13
3 files changed, 20 insertions, 9 deletions
diff --git a/sysdeps/unix/sysv/linux/kernel-features.h b/sysdeps/unix/sysv/linux/kernel-features.h
index 5f1ffdb9c5..2fa8524db9 100644
--- a/sysdeps/unix/sysv/linux/kernel-features.h
+++ b/sysdeps/unix/sysv/linux/kernel-features.h
@@ -532,7 +532,8 @@
/* Support for preadv and pwritev was added in 2.6.30. */
#if __LINUX_KERNEL_VERSION >= 0x02061e \
- && (defined __i386__ || defined __x86_64__ || defined __powerpc__)
+ && (defined __i386__ || defined __x86_64__ || defined __powerpc__ \
+ || defined __ia64__ || defined __sparc__ && defined __sh__)
# define __ASSUME_PREADV 1
# define __ASSUME_PWRITEV 1
#endif
diff --git a/sysdeps/unix/sysv/linux/preadv.c b/sysdeps/unix/sysv/linux/preadv.c
index e2f8238596..0d4a6c3803 100644
--- a/sysdeps/unix/sysv/linux/preadv.c
+++ b/sysdeps/unix/sysv/linux/preadv.c
@@ -29,6 +29,7 @@
#include <sys/syscall.h>
#include <kernel-features.h>
+
#ifndef PREADV
# define PREADV preadv
# define PREADV_REPLACEMENT __atomic_preadv_replacement
@@ -36,8 +37,10 @@
# define OFF_T off_t
#endif
+#ifndef __ASSUME_PREADV
static ssize_t PREADV_REPLACEMENT (int, __const struct iovec *,
int, OFF_T) internal_function;
+#endif
ssize_t
@@ -51,14 +54,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);
}
diff --git a/sysdeps/unix/sysv/linux/pwritev.c b/sysdeps/unix/sysv/linux/pwritev.c
index df430ffe46..5c30eae51f 100644
--- a/sysdeps/unix/sysv/linux/pwritev.c
+++ b/sysdeps/unix/sysv/linux/pwritev.c
@@ -29,6 +29,7 @@
#include <sys/syscall.h>
#include <kernel-features.h>
+
#ifndef PWRITEV
# define PWRITEV pwritev
# define PWRITEV_REPLACEMENT __atomic_pwritev_replacement
@@ -36,8 +37,10 @@
# define OFF_T off_t
#endif
+#ifndef __ASSUME_PWRITEV
static ssize_t PWRITEV_REPLACEMENT (int, __const struct iovec *,
int, OFF_T) internal_function;
+#endif
ssize_t
@@ -51,14 +54,16 @@ PWRITEV (fd, vector, count, offset)
ssize_t result;
if (SINGLE_THREAD_P)
- result = INLINE_SYSCALL (pwritev, 5, fd, vector, count, offset >> 32,
- offset & 0xffffffff);
+ result = INLINE_SYSCALL (pwritev, 5, fd, vector, count,
+ (off_t) ((off64_t) offset >> 32),
+ (off_t) (offset & 0xffffffff));
else
{
int oldtype = LIBC_CANCEL_ASYNC ();
- result = INLINE_SYSCALL (pwritev, 5, fd, vector, count, offset >> 32,
- offset & 0xffffffff);
+ result = INLINE_SYSCALL (pwritev, 5, fd, vector, count,
+ (off_t) ((off64_t) offset >> 32),
+ (off_t) (offset & 0xffffffff));
LIBC_CANCEL_RESET (oldtype);
}