[RFC PATCH 36/38] llseek: accept __NR_llseek

Jonas Bonn jonas at southpole.se
Tue Sep 6 08:31:00 UTC 2011


The asm-generic/unistd.h header in Linux defined __NR_llseek instead of
__NR__llseek.  Allow this version of the definition to be accepted by the
lseek64 implementation.

Signed-off-by: Jonas Bonn <jonas at southpole.se>
---
 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 cd150ad..124f037 100644
--- a/libc/sysdeps/linux/common/llseek.c
+++ b/libc/sysdeps/linux/common/llseek.c
@@ -11,13 +11,18 @@
 #include <sys/types.h>
 #include <sys/syscall.h>
 
-#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;
+#ifdef __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.5.4



More information about the uClibc mailing list