[PATCH 38/46] llseek: Use the llseek system call if defined

Markos Chandras markos.chandras at gmail.com
Tue Nov 13 11:31:47 UTC 2012


From: Markos Chandras <markos.chandras at imgtec.com>

Signed-off-by: Markos Chandras <markos.chandras at imgtec.com>
---
 libc/sysdeps/linux/common/llseek.c |    7 ++++++-
 1 files changed, 6 insertions(+), 1 deletions(-)

diff --git a/libc/sysdeps/linux/common/llseek.c b/libc/sysdeps/linux/common/llseek.c
index ff16917..3ca05d8 100644
--- a/libc/sysdeps/linux/common/llseek.c
+++ b/libc/sysdeps/linux/common/llseek.c
@@ -16,13 +16,18 @@
 # define __NR__llseek __NR_llseek
 #endif
 
-#if defined __NR__llseek && defined __UCLIBC_HAS_LFS__
+#if (defined __NR__llseek ||defined __NR_llseek) && defined __UCLIBC_HAS_LFS__
 
 loff_t lseek64(int fd, loff_t offset, int whence)
 {
 	loff_t result;
+#if defined(__NR_llseek)
+	return (loff_t)(INLINE_SYSCALL(llseek, 5, fd, (off_t)(offset >> 32),
+		(off_t)(offset & 0xffffffff), &result, whence) ? : result);
+#else
 	return (loff_t)(INLINE_SYSCALL(_llseek, 5, fd, (off_t) (offset >> 32),
 				(off_t) (offset & 0xffffffff), &result, whence) ?: result);
+#endif
 }
 
 #else
-- 
1.7.1




More information about the uClibc mailing list