|
@@ -15,11 +15,20 @@
|
|
|
# define __NR___lseek_nocancel __NR_lseek
|
|
|
_syscall3(off_t, __NC(lseek), int, fd, off_t, offset, int, whence)
|
|
|
|
|
|
-#elif !defined __NR_lseek && defined __NR_llseek \
|
|
|
- && __WORDSIZE == 32 && __UCLIBC_HAS_LFS__
|
|
|
+#elif !defined __NR_lseek && defined __NR_llseek
|
|
|
+#include <endian.h>
|
|
|
off_t __NC(lseek)(int fd, off_t offset, int whence)
|
|
|
{
|
|
|
+#if defined __UCLIBC_HAS_LFS__
|
|
|
return lseek64(fd, offset, whence);
|
|
|
+#elif __WORDSIZE == 32
|
|
|
+ __off64_t result;
|
|
|
+ __off_t high = 0;
|
|
|
+ return INLINE_SYSCALL(llseek, 5, fd,
|
|
|
+ __LONG_LONG_PAIR(high, offset),
|
|
|
+ &result, whence) ?: result;
|
|
|
+#endif
|
|
|
+
|
|
|
}
|
|
|
#else
|
|
|
# include <errno.h>
|