[PATCH 3/8] Use glibc syscall if possible

Andi Kleen <[email protected]> Wed, 14 Dec 2011 11:38:33 -0800
Newsgroups org.kernel.vger.linux-numa
Message-ID <[email protected]>
From: Andi Kleen <[email protected]>

Modern glibcs seem to have a working 6 argument syscall, so
use the glibc syscall stub if possible.
---
 syscall.c |   10 +++++++++-
 1 files changed, 9 insertions(+), 1 deletions(-)

diff --git a/syscall.c b/syscall.c
index 7b3fe9e..6d0f788 100755
--- a/syscall.c
+++ b/syscall.c
@@ -115,7 +115,15 @@
 
 #endif
 
-#if defined(__x86_64__)
+#if defined(__GLIBC__) && __GLIBC_PREREQ(2, 11) 
+
+/* glibc 2.11 seems to have working 6 argument sycall. Use the
+   glibc supplied syscall in this case.
+   The version cut-off is rather arbitary and could be probably
+   earlier. */
+
+#define syscall6 syscall
+#elif defined(__x86_64__)
 /* 6 argument calls on x86-64 are often buggy in both glibc and
    asm/unistd.h. Add a working version here. */
 long syscall6(long call, long a, long b, long c, long d, long e, long f)
-- 
1.7.5.4