dl-syscalls.h 778 B

12345678910111213141516171819202122232425
  1. /* Copyright (C) 2010 Texas Instruments Incorporated
  2. * Contributed by Mark Salter <msalter@redhat.com>
  3. *
  4. * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
  5. */
  6. /* We can't use the real errno in ldso, since it has not yet
  7. * been dynamicly linked in yet. */
  8. #include "sys/syscall.h"
  9. extern int _dl_errno;
  10. #undef __set_errno
  11. #define __set_errno(X) {(_dl_errno) = (X);}
  12. #include <sys/mman.h>
  13. #ifdef __NR_pread64
  14. #define __NR___syscall_pread __NR_pread64
  15. static __always_inline _syscall5(ssize_t, __syscall_pread, int, fd, void *, buf,
  16. size_t, count, off_t, offset_hi, off_t, offset_lo);
  17. static __always_inline ssize_t
  18. _dl_pread(int fd, void *buf, size_t count, off_t offset)
  19. {
  20. return(__syscall_pread(fd,buf,count, offset, offset >> 31));
  21. }
  22. #endif