summaryrefslogtreecommitdiff
path: root/ldso/include/dl-syscall.h
diff options
context:
space:
mode:
Diffstat (limited to 'ldso/include/dl-syscall.h')
-rw-r--r--ldso/include/dl-syscall.h22
1 files changed, 22 insertions, 0 deletions
diff --git a/ldso/include/dl-syscall.h b/ldso/include/dl-syscall.h
index 7539c2231..547dad1c8 100644
--- a/ldso/include/dl-syscall.h
+++ b/ldso/include/dl-syscall.h
@@ -108,6 +108,28 @@ static __always_inline _syscall0(gid_t, _dl_getpid)
static __always_inline _syscall3(int, _dl_readlink, const char *, path, char *, buf,
size_t, bufsiz)
+#ifdef __NR_pread64
+#define __NR___syscall_pread __NR_pread64
+static __always_inline _syscall5(ssize_t, __syscall_pread, int, fd, void *, buf,
+ size_t, count, off_t, offset_hi, off_t, offset_lo)
+
+static __always_inline ssize_t
+_dl_pread(int fd, void *buf, size_t count, off_t offset)
+{
+ return __syscall_pread(fd, buf, count, offset, offset >> 31);
+}
+#elif defined __NR_pread
+#define __NR___syscall_pread __NR_pread
+static __always_inline _syscall5(ssize_t, __syscall_pread, int, fd, void *, buf,
+ size_t, count, off_t, offset_hi, off_t, offset_lo)
+
+static __always_inline ssize_t
+_dl_pread(int fd, void *buf, size_t count, off_t offset)
+{
+ return __syscall_pread(fd, buf, count, __LONG_LONG_PAIR(offset >> 31, offset));
+}
+#endif
+
#ifdef __UCLIBC_HAS_SSP__
# include <sys/time.h>
# define __NR__dl_gettimeofday __NR_gettimeofday