svn commit: trunk/uClibc/libc/sysdeps/linux/powerpc

aldot at uclibc.org aldot at uclibc.org
Wed Aug 20 07:42:33 UTC 2008


Author: aldot
Date: 2008-08-20 00:42:33 -0700 (Wed, 20 Aug 2008)
New Revision: 23116

Log:
- Fix powerpc pread/pwrite (Wade Berrier)
  pread/write wanted to send an 8 byte value in the syscall where only 4 bytes
  were allowed.


Modified:
   trunk/uClibc/libc/sysdeps/linux/powerpc/pread_write.c


Changeset:
Modified: trunk/uClibc/libc/sysdeps/linux/powerpc/pread_write.c
===================================================================
--- trunk/uClibc/libc/sysdeps/linux/powerpc/pread_write.c	2008-08-20 06:35:26 UTC (rev 23115)
+++ trunk/uClibc/libc/sysdeps/linux/powerpc/pread_write.c	2008-08-20 07:42:33 UTC (rev 23116)
@@ -14,6 +14,7 @@
 
 #include <sys/syscall.h>
 #include <unistd.h>
+#include <endian.h>
 
 #ifndef __UCLIBC_HAS_LFS__
 # define off64_t off_t
@@ -22,12 +23,12 @@
 #ifdef __NR_pread
 extern __typeof(pread) __libc_pread;
 # define __NR___syscall_pread __NR_pread
-static __inline__ _syscall4(ssize_t, __syscall_pread, int, fd,
-		void *, buf, size_t, count, off64_t, offset);
+static __inline__ _syscall6(ssize_t, __syscall_pread, int, fd,
+		void *, buf, size_t, count, int, dummy, off_t, offset_hi, off_t, offset_lo);
 
 ssize_t __libc_pread(int fd, void *buf, size_t count, off_t offset)
 {
-	return(__syscall_pread(fd, buf, count, (off64_t)offset));
+	return(__syscall_pread(fd, buf, count, 0, __LONG_LONG_PAIR(offset >> 31, offset)));
 }
 weak_alias(__libc_pread,pread)
 
@@ -35,7 +36,7 @@
 extern __typeof(pread64) __libc_pread64;
 ssize_t __libc_pread64(int fd, void *buf, size_t count, off64_t offset)
 {
-	return(__syscall_pread(fd, buf, count, offset));
+	return(__syscall_pread(fd, buf, count, 0, __LONG_LONG_PAIR(offset >> 32, offset)));
 }
 weak_alias(__libc_pread64,pread64)
 # endif /* __UCLIBC_HAS_LFS__  */
@@ -45,12 +46,12 @@
 #ifdef __NR_pwrite
 extern __typeof(pwrite) __libc_pwrite;
 # define __NR___syscall_pwrite __NR_pwrite
-static __inline__ _syscall4(ssize_t, __syscall_pwrite, int, fd,
-		const void *, buf, size_t, count, off64_t, offset);
+static __inline__ _syscall6(ssize_t, __syscall_pwrite, int, fd,
+		const void *, buf, size_t, count, int, dummy, off_t, offset_hi, off_t, offset_lo);
 
 ssize_t __libc_pwrite(int fd, const void *buf, size_t count, off_t offset)
 {
-	return(__syscall_pwrite(fd, buf, count, (off64_t)offset));
+	return(__syscall_pwrite(fd, buf, count, 0, __LONG_LONG_PAIR(offset >> 31, offset)));
 }
 weak_alias(__libc_pwrite,pwrite)
 
@@ -58,7 +59,7 @@
 extern __typeof(pwrite64) __libc_pwrite64;
 ssize_t __libc_pwrite64(int fd, const void *buf, size_t count, off64_t offset)
 {
-	return(__syscall_pwrite(fd, buf, count, offset));
+	return(__syscall_pwrite(fd, buf, count, 0, __LONG_LONG_PAIR(offset >> 32, offset)));
 }
 weak_alias(__libc_pwrite64,pwrite64)
 # endif /* __UCLIBC_HAS_LFS__  */
@@ -87,7 +88,7 @@
 	if (lseek (fd, offset, SEEK_SET) == (off_t) -1)
 		return -1;
 
-	if (do_pwrite==1) {
+	if (do_pwrite == 1) {
 		/* Write the data.  */
 		result = write(fd, buf, count);
 	} else {
@@ -127,7 +128,7 @@
 	if (lseek64(fd, offset, SEEK_SET) == (off64_t) -1)
 		return -1;
 
-	if (do_pwrite==1) {
+	if (do_pwrite == 1) {
 		/* Write the data.  */
 		result = write(fd, buf, count);
 	} else {




More information about the uClibc-cvs mailing list