pread_write.c 1.0 KB

123456789101112131415161718192021222324252627282930
  1. /*
  2. * Copyright (C) 2000-2006 Erik Andersen <andersen@uclibc.org>
  3. *
  4. * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
  5. */
  6. #include <sys/syscall.h>
  7. #include <unistd.h>
  8. #include <endian.h>
  9. #include <sgidefs.h>
  10. /* We should generalize this for 32bit userlands w/64bit regs. This applies
  11. * to the x86_64 x32 and the mips n32 ABIs. */
  12. #if _MIPS_SIM == _MIPS_SIM_NABI32
  13. # define __NR___syscall_pread __NR_pread64
  14. static _syscall4(ssize_t, __syscall_pread, int, fd, void *, buf, size_t, count, off_t, offset)
  15. # define MY_PREAD(fd, buf, count, offset) \
  16. __syscall_pread(fd, buf, count, offset)
  17. # define MY_PREAD64(fd, buf, count, offset) \
  18. __syscall_pread(fd, buf, count, offset)
  19. # define __NR___syscall_pwrite __NR_pwrite64
  20. static _syscall4(ssize_t, __syscall_pwrite, int, fd, const void *, buf, size_t, count, off_t, offset)
  21. # define MY_PWRITE(fd, buf, count, offset) \
  22. __syscall_pwrite(fd, buf, count, offset)
  23. # define MY_PWRITE64(fd, buf, count, offset) \
  24. __syscall_pwrite(fd, buf, count, offset)
  25. #endif
  26. #include "../common/pread_write.c"