From: Enrico Scholz Date: Fri, 13 Feb 2004 23:42:37 +0000 (+0000) Subject: This commit was manufactured by cvs2svn to create branch X-Git-Tag: version_0_30~30 X-Git-Url: http://git.linux-vserver.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=2c79c38cbbaf8a66e2645c6b1648e91d6940c5ae;p=util-vserver.git This commit was manufactured by cvs2svn to create branch 'SYSCALL_SWITCH'. git-svn-id: http://svn.linux-vserver.org/svn/util-vserver/branches/SYSCALL_SWITCH@884 94cd875c-1c1d-0410-91d2-eb244daf1a30 --- diff --git a/util-vserver/m4/ensc_syscallnr.m4 b/util-vserver/m4/ensc_syscallnr.m4 new file mode 100644 index 0000000..1ab1e7e --- /dev/null +++ b/util-vserver/m4/ensc_syscallnr.m4 @@ -0,0 +1,55 @@ +dnl $Id$ + +dnl Copyright (C) 2004 Enrico Scholz +dnl +dnl This program is free software; you can redistribute it and/or modify +dnl it under the terms of the GNU General Public License as published by +dnl the Free Software Foundation; version 2 of the License. +dnl +dnl This program is distributed in the hope that it will be useful, +dnl but WITHOUT ANY WARRANTY; without even the implied warranty of +dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +dnl GNU General Public License for more details. +dnl +dnl You should have received a copy of the GNU General Public License +dnl along with this program; if not, write to the Free Software +dnl Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + +dnl Usage: ENSC_SYSCALLNR(,) + +AC_DEFUN([ENSC_SYSCALLNR], +[ + AC_REQUIRE([ENSC_KERNEL_HEADERS]) + AC_REQUIRE([AC_PROG_EGREP]) + + AC_CACHE_CHECK([for syscall '$1'], [ensc_cv_value_syscall_$1], + [ + AC_LANG_PUSH(C) + AC_EGREP_CPP(ensc_cv_value_syscall_$1=auto, [ +#include +#ifdef __NR_$1 +ensc_cv_value_syscall_$1=auto +#endif +], + [ensc_cv_value_syscall_$1=auto], [ + AC_LANG_CONFTEST([ +#include +#ifdef __NR_$1 +ensc_cv_value_syscall_$1=__NR_$1 +#else +ensc_cv_value_syscall_$1=$2 +#endif +]) + eval $($CPP $CPPFLAGS -I$ensc_cv_path_kernelheaders conftest.c | $EGREP -x 'ensc_cv_value_syscall_$1=[[1-9]][[0-9]]*') + if test x"$ensc_cv_value_syscall_$1" = x; then + AC_MSG_ERROR( +[Can not determine value of __NR_$1; please verify your glibc/kernelheaders, and/or set CPPFLAGS='-D=__NR_$1=' environment when calling configure.]) + fi + ]) + AC_LANG_POP + ]) + + if test "$ensc_cv_value_syscall_$1" != xauto; then + AC_DEFINE_UNQUOTED(ENSC_SYSCALL__NR_$1, $ensc_cv_value_syscall_$1, [The number of the $1 syscall]) + fi +])