xxx-n32-pread_pwrite.patch 1.4 KB

1234567891011121314151617181920212223242526272829303132
  1. Uclibc is not building for MIPS N64 because pread is trying to use the
  2. pread/pwrite system calls instead of pread64/pwrite64. This patch fixes
  3. the problem and was tested with LFS enabled and disabled.
  4. Signed-off-by: Steve Ellcey <sellcey@mips.com>
  5. ---
  6. libc/sysdeps/linux/mips/pread_write.c | 4 ++--
  7. 1 file changed, 2 insertions(+), 2 deletions(-)
  8. diff --git a/libc/sysdeps/linux/mips/pread_write.c b/libc/sysdeps/linux/mips/pread_write.c
  9. index 3dc97c9..1220fec 100644
  10. --- a/libc/sysdeps/linux/mips/pread_write.c
  11. +++ b/libc/sysdeps/linux/mips/pread_write.c
  12. @@ -13,14 +13,14 @@
  13. /* We should generalize this for 32bit userlands w/64bit regs. This applies
  14. * to the x86_64 x32 and the mips n32 ABIs. */
  15. #if _MIPS_SIM == _MIPS_SIM_NABI32
  16. -# define __NR___syscall_pread __NR_pread
  17. +# define __NR___syscall_pread __NR_pread64
  18. static _syscall4(ssize_t, __syscall_pread, int, fd, void *, buf, size_t, count, off_t, offset)
  19. # define MY_PREAD(fd, buf, count, offset) \
  20. __syscall_pread(fd, buf, count, offset)
  21. # define MY_PREAD64(fd, buf, count, offset) \
  22. __syscall_pread(fd, buf, count, offset)
  23. -# define __NR___syscall_pwrite __NR_pwrite
  24. +# define __NR___syscall_pwrite __NR_pwrite64
  25. static _syscall4(ssize_t, __syscall_pwrite, int, fd, const void *, buf, size_t, count, off_t, offset)
  26. # define MY_PWRITE(fd, buf, count, offset) \
  27. __syscall_pwrite(fd, buf, count, offset)
  28. --
  29. 1.7.9.5