OSDN Git Service

libc: fix mips N64 pread/pwrite build
authorSteve Ellcey <sellcey@mips.com>
Thu, 13 Feb 2014 22:33:03 +0000 (14:33 -0800)
committerBernhard Reutner-Fischer <rep.dot.nop@gmail.com>
Wed, 12 Mar 2014 20:00:24 +0000 (21:00 +0100)
Uclibc is not building for MIPS N64 because pread is trying to use the
pread/pwrite system calls instead of pread64/pwrite64.  This patch fixes
the problem and was tested with LFS enabled and disabled.

Signed-off-by: Steve Ellcey <sellcey@mips.com>
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
libc/sysdeps/linux/mips/pread_write.c

index 3dc97c9..1220fec 100644 (file)
 /* We should generalize this for 32bit userlands w/64bit regs.  This applies
  * to the x86_64 x32 and the mips n32 ABIs.  */
 #if _MIPS_SIM == _MIPS_SIM_NABI32
 /* We should generalize this for 32bit userlands w/64bit regs.  This applies
  * to the x86_64 x32 and the mips n32 ABIs.  */
 #if _MIPS_SIM == _MIPS_SIM_NABI32
-# define __NR___syscall_pread __NR_pread
+# define __NR___syscall_pread __NR_pread64
 static _syscall4(ssize_t, __syscall_pread, int, fd, void *, buf, size_t, count, off_t, offset)
 # define MY_PREAD(fd, buf, count, offset) \
        __syscall_pread(fd, buf, count, offset)
 # define MY_PREAD64(fd, buf, count, offset) \
        __syscall_pread(fd, buf, count, offset)
 
 static _syscall4(ssize_t, __syscall_pread, int, fd, void *, buf, size_t, count, off_t, offset)
 # define MY_PREAD(fd, buf, count, offset) \
        __syscall_pread(fd, buf, count, offset)
 # define MY_PREAD64(fd, buf, count, offset) \
        __syscall_pread(fd, buf, count, offset)
 
-# define __NR___syscall_pwrite __NR_pwrite
+# define __NR___syscall_pwrite __NR_pwrite64
 static _syscall4(ssize_t, __syscall_pwrite, int, fd, const void *, buf, size_t, count, off_t, offset)
 # define MY_PWRITE(fd, buf, count, offset) \
        __syscall_pwrite(fd, buf, count, offset)
 static _syscall4(ssize_t, __syscall_pwrite, int, fd, const void *, buf, size_t, count, off_t, offset)
 # define MY_PWRITE(fd, buf, count, offset) \
        __syscall_pwrite(fd, buf, count, offset)