From 0d36067b00bc8bd7925808169454a596c1f84bb6 Mon Sep 17 00:00:00 2001 From: Enrico Scholz Date: Thu, 5 Feb 2004 03:42:47 +0000 Subject: [PATCH] enhanced check by using kernel headers git-svn-id: http://svn.linux-vserver.org/svn/util-vserver/trunk@803 94cd875c-1c1d-0410-91d2-eb244daf1a30 --- util-vserver/m4/ensc_syscall.m4 | 37 +++++++++++++++++++++++++++++++------ 1 file changed, 31 insertions(+), 6 deletions(-) diff --git a/util-vserver/m4/ensc_syscall.m4 b/util-vserver/m4/ensc_syscall.m4 index 8d2feed..7c03511 100644 --- a/util-vserver/m4/ensc_syscall.m4 +++ b/util-vserver/m4/ensc_syscall.m4 @@ -19,6 +19,7 @@ dnl Usage: ENSC_SYSCALL AC_DEFUN([ENSC_SYSCALL], [ + AC_REQUIRE([ENSC_KERNEL_HEADERS]) AC_MSG_CHECKING([for syscall(2) invocation method]) AC_ARG_WITH([syscall], [AC_HELP_STRING([--with-syscall=METHOD], @@ -30,18 +31,42 @@ AC_DEFUN([ENSC_SYSCALL], case x"$with_syscall" in xauto) AC_CACHE_CHECK([which syscall(2) invocation works], [ensc_cv_test_syscall], - [AC_COMPILE_IFELSE([ + [ + old_CPPFLAGS=$CPPFLAGS + CPPFLAGS="-I$ensc_cv_path_kernelheaders" + AC_LANG_PUSH(C) + AC_COMPILE_IFELSE([ #include #include #include -#define __NR_foo 300 -inline static _syscall4(int, foo, int, a, int, b, int, c, int, d) +#define __NR_foo0 300 +#define __NR_foo1 301 +#define __NR_foo2 302 +#define __NR_foo3 303 +#define __NR_foo4 304 +#define __NR_foo5 305 +inline static _syscall0(int, foo0) +inline static _syscall1(int, foo1, int, a) +inline static _syscall2(int, foo2, int, a, int, b) +inline static _syscall3(int, foo3, int, a, int, b, int, c) +inline static _syscall4(int, foo4, int, a, int, b, int, c, int, d) +inline static _syscall5(int, foo5, int, a, int, b, int, c, int, d, int, e) int main() { - return foo(1,2,3,4); + return foo0() || \ + foo1(1) || \ + foo2(1,2) || \ + foo3(1,2,3) || \ + foo4(1,2,3,4) || \ + foo5(1,2,3,4,5); } - ], - [ensc_cv_test_syscall=fast],[ensc_cv_test_syscall=traditional])]) + ], + [ensc_cv_test_syscall=fast], + [ensc_cv_test_syscall=traditional]) + + AC_LANG_POP + CPPFLAGS=$old_CPPFLAGS + ]) with_syscall=$ensc_cv_test_syscall ;; xfast|xtraditional) -- 1.8.1.5