diff options
author | Carmelo Amoroso <carmelo.amoroso@st.com> | 2008-11-27 14:38:34 +0000 |
---|---|---|
committer | Carmelo Amoroso <carmelo.amoroso@st.com> | 2008-11-27 14:38:34 +0000 |
commit | c836f1ad544d4b57dd1b93c480b7e625f24fb147 (patch) | |
tree | 97669f5a5ddf6d10280b4d58dc759459c9613a54 /libc/sysdeps/linux/powerpc/pread_write.c | |
parent | 0dbf6abb93407b6aa83f8a3b397cafbd3095cfdc (diff) | |
download | uClibc-alpine-c836f1ad544d4b57dd1b93c480b7e625f24fb147.tar.bz2 uClibc-alpine-c836f1ad544d4b57dd1b93c480b7e625f24fb147.tar.xz |
Synch with trunk @ 24160
Step 14: miscellaneous merge for arch specific
files in libc/sysdeps. Comments, cleanup, formatting,
hidden_proto removal and others.
Diffstat (limited to 'libc/sysdeps/linux/powerpc/pread_write.c')
-rw-r--r-- | libc/sysdeps/linux/powerpc/pread_write.c | 29 |
1 files changed, 15 insertions, 14 deletions
diff --git a/libc/sysdeps/linux/powerpc/pread_write.c b/libc/sysdeps/linux/powerpc/pread_write.c index cdbadfdf3..dcdb39be1 100644 --- a/libc/sysdeps/linux/powerpc/pread_write.c +++ b/libc/sysdeps/linux/powerpc/pread_write.c @@ -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 @@ weak_alias(__libc_pread,pread) 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 @@ weak_alias(__libc_pread64,pread64) #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 @@ weak_alias(__libc_pwrite,pwrite) 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__ */ @@ -67,9 +68,9 @@ weak_alias(__libc_pwrite64,pwrite64) #if ! defined __NR_pread || ! defined __NR_pwrite -libc_hidden_proto(read) -libc_hidden_proto(write) -libc_hidden_proto(lseek) +/* libc_hidden_proto(read) */ +/* libc_hidden_proto(write) */ +/* libc_hidden_proto(lseek) */ static ssize_t __fake_pread_write(int fd, void *buf, size_t count, off_t offset, int do_pwrite) @@ -87,7 +88,7 @@ static ssize_t __fake_pread_write(int fd, void *buf, 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 { @@ -109,7 +110,7 @@ static ssize_t __fake_pread_write(int fd, void *buf, } # ifdef __UCLIBC_HAS_LFS__ -libc_hidden_proto(lseek64) +/* libc_hidden_proto(lseek64) */ static ssize_t __fake_pread_write64(int fd, void *buf, size_t count, off64_t offset, int do_pwrite) @@ -127,7 +128,7 @@ static ssize_t __fake_pread_write64(int fd, void *buf, 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 { |