[git commit] llseek: support __NR_llseek syscall

Mike Frysinger vapier at gentoo.org
Fri Apr 27 03:11:02 UTC 2012


commit: http://git.uclibc.org/uClibc/commit/?id=7bad8cf68b6e2434686bd80182f4a5bc22004416
branch: http://git.uclibc.org/uClibc/commit/?id=refs/heads/master

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>
Signed-off-by: Mike Frysinger <vapier at gentoo.org>
---
 libc/sysdeps/linux/common/llseek.c |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)

diff --git a/libc/sysdeps/linux/common/llseek.c b/libc/sysdeps/linux/common/llseek.c
index cd150ad..ff16917 100644
--- a/libc/sysdeps/linux/common/llseek.c
+++ b/libc/sysdeps/linux/common/llseek.c
@@ -11,6 +11,11 @@
 #include <sys/types.h>
 #include <sys/syscall.h>
 
+/* Newer kernel ports have llseek() instead of _llseek() */
+#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)


More information about the uClibc-cvs mailing list