summaryrefslogtreecommitdiff
path: root/libc
diff options
context:
space:
mode:
authorMark Salter <msalter@redhat.com>2012-04-26 10:14:49 -0400
committerMike Frysinger <vapier@gentoo.org>2012-04-26 23:11:02 -0400
commit7bad8cf68b6e2434686bd80182f4a5bc22004416 (patch)
tree8f1b2b42f64842638c47eaa6388bfe45931bf205 /libc
parent9f096becc4b9a49051eceb6c94a3c088c519c04d (diff)
llseek: support __NR_llseek syscall
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@redhat.com> Signed-off-by: Mike Frysinger <vapier@gentoo.org>
Diffstat (limited to 'libc')
-rw-r--r--libc/sysdeps/linux/common/llseek.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/libc/sysdeps/linux/common/llseek.c b/libc/sysdeps/linux/common/llseek.c
index cd150ad9f..ff16917e2 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)