about summary refs log tree commit diff
path: root/sysdeps/unix/sysv/linux/preadv.c
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>2009-04-23 22:52:24 +0000
committerUlrich Drepper <drepper@redhat.com>2009-04-23 22:52:24 +0000
commit7f8a28efb5c9bf19d3a31a7f356cc171f333ceef (patch)
tree03175c4a76429b3f571b81770394ae731732711e /sysdeps/unix/sysv/linux/preadv.c
parentc7e74e5968929264fca40424f979653115643f5d (diff)
downloadglibc-7f8a28efb5c9bf19d3a31a7f356cc171f333ceef.tar.gz
glibc-7f8a28efb5c9bf19d3a31a7f356cc171f333ceef.tar.xz
glibc-7f8a28efb5c9bf19d3a31a7f356cc171f333ceef.zip
* sysdeps/unix/sysv/linux/preadv.c: The kernel API changed. Adjust.
	* sysdeps/unix/sysv/linux/pwritev.c: Likewise.

2009-04-23  Jakub Jelinek  <jakub@redhat.com>

	* sysdeps/posix/pwritev.c (PWRITEV): Fix up comment.  Copy
	data from vector to temporary buffer and call PWRITEV after it
	instead of vice versa.
	* sysdeps/posix/preadv.c: Fix up comment.
	* misc/preadv.c: Likewise.
	* misc/preadv64.c: Likewise.
	* misc/pwritev.c: Likewise.
	* misc/pwritev64.c: Likewise.
	* misc/sys/uio.h (preadv, pwritev, preadv64, pwritev64): Likewise.

2009-04-23  Ulrich Drepper  <drepper@redhat.com>
Diffstat (limited to 'sysdeps/unix/sysv/linux/preadv.c')
-rw-r--r--sysdeps/unix/sysv/linux/preadv.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/sysdeps/unix/sysv/linux/preadv.c b/sysdeps/unix/sysv/linux/preadv.c
index 0d4a6c3803..72722ebc0d 100644
--- a/sysdeps/unix/sysv/linux/preadv.c
+++ b/sysdeps/unix/sysv/linux/preadv.c
@@ -37,6 +37,10 @@
 # define OFF_T off_t
 #endif
 
+#define LO_HI_LONG(val) \
+  (off_t) val,								\
+  (off_t) ((((uint64_t) (val)) >> (sizeof (long) * 4)) >> (sizeof (long) * 4))
+
 #ifndef __ASSUME_PREADV
 static ssize_t PREADV_REPLACEMENT (int, __const struct iovec *,
 				   int, OFF_T) internal_function;
@@ -55,15 +59,13 @@ PREADV (fd, vector, count, offset)
 
   if (SINGLE_THREAD_P)
     result = INLINE_SYSCALL (preadv, 5, fd, vector, count,
-			     (off_t) ((off64_t) offset >> 32),
-			     (off_t) (offset & 0xffffffff));
+			     LO_HI_LONG (offset));
   else
     {
       int oldtype = LIBC_CANCEL_ASYNC ();
 
       result = INLINE_SYSCALL (preadv, 5, fd, vector, count,
-			       (off_t) ((off64_t) offset >> 32),
-			       (off_t) (offset & 0xffffffff));
+			       LO_HI_LONG (offset));
 
       LIBC_CANCEL_RESET (oldtype);
     }