summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarkos Chandras <markos.chandras@imgtec.com>2013-01-21 10:59:14 +0000
committerBernhard Reutner-Fischer <rep.dot.nop@gmail.com>2013-02-20 13:45:12 +0100
commit524744db1f05b57dc254419009370a8577a49894 (patch)
tree797c6e4274d32e73e9ead45538487b4ec396af57
parenta83ea57a508362f8f66ecd89131302fba1223637 (diff)
lseek: Use lseek64 is arch does not have the lseek syscall
Signed-off-by: Markos Chandras <markos.chandras@imgtec.com> Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
-rw-r--r--libc/sysdeps/linux/common/lseek.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/libc/sysdeps/linux/common/lseek.c b/libc/sysdeps/linux/common/lseek.c
index 3032a27b9..26953ae66 100644
--- a/libc/sysdeps/linux/common/lseek.c
+++ b/libc/sysdeps/linux/common/lseek.c
@@ -14,6 +14,13 @@
#ifdef __NR_lseek
# define __NR___lseek_nocancel __NR_lseek
_syscall3(off_t, __NC(lseek), int, fd, off_t, offset, int, whence)
+/* Use lseek64 if __NR_lseek is not defined but UCLIBC_HAS_LFS is enabled */
+#elif !defined __NR_lseek && defined __NR_llseek \
+ && __WORDSIZE == 32 && __UCLIBC_HAS_LFS__
+off_t __NC(lseek)(int fd, off_t offset, int whence)
+{
+ return lseek64(fd, offset, whence);
+}
#else
# include <errno.h>
off_t __NC(lseek)(int fd, off_t offset attribute_unused, int whence)