[PATCH] Support __NR_llseek syscall.

Mark Salter msalter at redhat.com
Thu Apr 26 14:14:49 UTC 2012


Older kernels use __NR__llseek for a 64-bit lseek syscall. Newer
kernels use __NR_llseek. This patch fixes the implementation of
lseek64 to use the __NR_llseek syscall if it exists.

Signed-off-by: Mark Salter <msalter at redhat.com>
---
 libc/sysdeps/linux/common/llseek.c |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/libc/sysdeps/linux/common/llseek.c b/libc/sysdeps/linux/common/llseek.c
index cd150ad..4e51fb0 100644
--- a/libc/sysdeps/linux/common/llseek.c
+++ b/libc/sysdeps/linux/common/llseek.c
@@ -11,6 +11,10 @@
 #include <sys/types.h>
 #include <sys/syscall.h>
 
+#if !defined __NR__llseek && defined __NR_llseek
+#define __NR__llseek __NR_llseek
+#endif
+
 #if defined __NR__llseek && defined __UCLIBC_HAS_LFS__
 
 loff_t lseek64(int fd, loff_t offset, int whence)
-- 
1.7.9.1



More information about the uClibc mailing list