pread_write.c 1.1 KB

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