Index: configure.ac =================================================================== RCS file: /cvsroot/util-vserver/util-vserver/configure.ac,v retrieving revision 1.1.2.1.2.31 retrieving revision 1.1.2.1.2.32 diff -u -p -I$Id: -r1.1.2.1.2.31 -r1.1.2.1.2.32 --- configure.ac 11 Feb 2004 21:06:17 -0000 1.1.2.1.2.31 +++ configure.ac 14 Feb 2004 00:25:56 -0000 1.1.2.1.2.32 @@ -25,7 +25,7 @@ dnl AC_PREREQ(2.57) -AC_INIT(util-vserver, 0.29, enrico.scholz@informatik.tu-chemnitz.de) +AC_INIT(util-vserver, 0.29.1, enrico.scholz@informatik.tu-chemnitz.de) AC_CONFIG_SRCDIR([src/capchroot.c]) AC_CONFIG_HEADER([config.h]) @@ -101,6 +101,7 @@ done IFS=$old_IFS AC_MSG_RESULT([$enable_apis]) +ENSC_SYSCALLNR(vserver,273) ENSC_SYSCALL ENSC_CHECK_EXT2FS_HEADER AC_CHECK_FUNCS([vserver]) Index: lib/vserver-internal.h =================================================================== RCS file: /cvsroot/util-vserver/util-vserver/lib/vserver-internal.h,v retrieving revision 1.1.4.13 retrieving revision 1.1.4.14 diff -u -p -I$Id: -r1.1.4.13 -r1.1.4.14 --- lib/vserver-internal.h 5 Feb 2004 03:52:45 -0000 1.1.4.13 +++ lib/vserver-internal.h 14 Feb 2004 00:25:34 -0000 1.1.4.14 @@ -26,8 +26,8 @@ #include #include -#ifndef __NR_vserver -# define __NR_vserver 273 +#if !defined(__NR_vserver) && defined(ENSC_SYSCALL__NR_vserver) +# define __NR_vserver ENSC_SYSCALL__NR_vserver #endif #define VC_PREFIX 0) Index: m4/ensc_syscallnr.m4 =================================================================== RCS file: m4/ensc_syscallnr.m4 diff -N m4/ensc_syscallnr.m4 --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ m4/ensc_syscallnr.m4 14 Feb 2004 00:24:57 -0000 1.1.2.1 @@ -0,0 +1,55 @@ +dnl $Id: ensc_syscallnr.m4,v 1.1.2.1 2004/02/14 00:24:57 ensc Exp $ + +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 number of 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 x"$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 +])