From: SUGIOKA T. <su...@it...> - 2002-11-06 05:30:25
|
At 11:38 02/11/01 +0900, NIIBE Yutaka <gn...@m1...> wrote: >I think that better way to solve this is implement pread with 6 >arguments with dummy fourth argument, as MIPS implementation. > >I mean, fix kernel, fix glibc, BOTH. Here is a patch to fix pread/pwrite. I'll commit to HEAD and 2.4 branch if no objections. I have also attached glibc-2.2.5 patch (by kaz kojima) for your reference. Index: arch/sh/kernel/entry.S =================================================================== RCS file: /cvsroot/linuxsh/linux/arch/sh/kernel/entry.S,v retrieving revision 1.1.1.1.2.11 diff -u -r1.1.1.1.2.11 entry.S --- arch/sh/kernel/entry.S 1 Oct 2002 00:43:32 -0000 1.1.1.1.2.11 +++ arch/sh/kernel/entry.S 6 Nov 2002 03:54:33 -0000 @@ -1147,8 +1147,8 @@ .long SYMBOL_NAME(sys_rt_sigtimedwait) .long SYMBOL_NAME(sys_rt_sigqueueinfo) .long SYMBOL_NAME(sys_rt_sigsuspend) - .long SYMBOL_NAME(sys_pread) /* 180 */ - .long SYMBOL_NAME(sys_pwrite) + .long SYMBOL_NAME(sys_pread_wrapper) /* 180 */ + .long SYMBOL_NAME(sys_pwrite_wrapper) .long SYMBOL_NAME(sys_chown16) .long SYMBOL_NAME(sys_getcwd) .long SYMBOL_NAME(sys_capget) Index: arch/sh/kernel/sys_sh.c =================================================================== RCS file: /cvsroot/linuxsh/linux/arch/sh/kernel/sys_sh.c,v retrieving revision 1.1.1.1 diff -u -r1.1.1.1 sys_sh.c --- arch/sh/kernel/sys_sh.c 15 Oct 2001 20:44:53 -0000 1.1.1.1 +++ arch/sh/kernel/sys_sh.c 6 Nov 2002 03:54:33 -0000 @@ -238,3 +238,19 @@ schedule(); return -ERESTARTNOHAND; } + +asmlinkage ssize_t sys_pread_wrapper(unsigned int fd, char * buf, + size_t count, long dummy, loff_t pos) +{ + extern asmlinkage ssize_t sys_pread(unsigned int fd, char * buf, + size_t count, loff_t pos); + return sys_pread(fd, buf, count, pos); +} + +asmlinkage ssize_t sys_pwrite_wrapper(unsigned int fd, const char * buf, + size_t count, long dummy, loff_t pos) +{ + extern asmlinkage ssize_t sys_pwrite(unsigned int fd, const char * buf, + size_t count, loff_t pos); + return sys_pwrite(fd, buf, count, pos); +} diff -ruN glibc-2.2.5.orig/sysdeps/unix/sysv/linux/sh/pread.c glibc-2.2.5/sysdeps/unix/sysv/linux/sh/pread.c --- glibc-2.2.5.orig/sysdeps/unix/sysv/linux/sh/pread.c Thu Jan 1 09:00:00 1970 +++ glibc-2.2.5/sysdeps/unix/sysv/linux/sh/pread.c Wed Nov 6 10:00:20 2002 @@ -0,0 +1 @@ +#include <sysdeps/unix/sysv/linux/mips/pread.c> diff -ruN glibc-2.2.5.orig/sysdeps/unix/sysv/linux/sh/pread64.c glibc-2.2.5/sysdeps/unix/sysv/linux/sh/pread64.c --- glibc-2.2.5.orig/sysdeps/unix/sysv/linux/sh/pread64.c Thu Jan 1 09:00:00 1970 +++ glibc-2.2.5/sysdeps/unix/sysv/linux/sh/pread64.c Wed Nov 6 10:00:44 2002 @@ -0,0 +1 @@ +#include <sysdeps/unix/sysv/linux/mips/pread64.c> diff -ruN glibc-2.2.5.orig/sysdeps/unix/sysv/linux/sh/pwrite.c glibc-2.2.5/sysdeps/unix/sysv/linux/sh/pwrite.c --- glibc-2.2.5.orig/sysdeps/unix/sysv/linux/sh/pwrite.c Thu Jan 1 09:00:00 1970 +++ glibc-2.2.5/sysdeps/unix/sysv/linux/sh/pwrite.c Wed Nov 6 10:01:32 2002 @@ -0,0 +1 @@ +#include <sysdeps/unix/sysv/linux/mips/pwrite.c> diff -ruN glibc-2.2.5.orig/sysdeps/unix/sysv/linux/sh/pwrite64.c glibc-2.2.5/sysdeps/unix/sysv/linux/sh/pwrite64.c --- glibc-2.2.5.orig/sysdeps/unix/sysv/linux/sh/pwrite64.c Thu Jan 1 09:00:00 1970 +++ glibc-2.2.5/sysdeps/unix/sysv/linux/sh/pwrite64.c Wed Nov 6 10:01:15 2002 @@ -0,0 +1 @@ +#include <sysdeps/unix/sysv/linux/mips/pwrite64.c> ---- SUGIOKA Toshinobu |