__NR_setns is defined in the Linux kernel headers in linux/unistd.h. The full Linux kernel sources are not necessary for compilation.
Signed-off-by: David Ward <david.w...@ll.mit.edu> --- config/linux.m4 | 76 --------------------------------------------------- configure.ac | 8 ++--- src/lxc/Makefile.am | 11 ------- src/lxc/attach.c | 3 +- 4 files changed, 4 insertions(+), 94 deletions(-) delete mode 100644 config/linux.m4 diff --git a/config/linux.m4 b/config/linux.m4 deleted file mode 100644 index a4e9fa8..0000000 --- a/config/linux.m4 +++ /dev/null @@ -1,76 +0,0 @@ -AC_DEFUN([AC_LINUX], -[ - AC_LINUX_DIR() - AC_LINUX_SRCARCH() -]) - -AC_DEFUN([AS_TRY_LINUX_DIR], - [AC_MSG_CHECKING(for Linux in $1) - - if test -f "$1/Makefile" ; then - result=yes - $2 - else - result="not found" - $3 - fi - - AC_MSG_RESULT($result) -]) - -AC_DEFUN([AC_LINUX_DIR], -[ - AC_ARG_WITH([linuxdir], - [AC_HELP_STRING([--with-linuxdir=DIR], - [specify path to Linux source directory])], - [LINUX_DIR="${withval}"], - [LINUX_DIR=default]) - - dnl if specified, use the specified one - if test "${LINUX_DIR}" != "default" ; then - AS_TRY_LINUX_DIR([${LINUX_DIR}], , AC_MSG_ERROR([Linux dir not found]) ) - fi - - dnl if not specified, first try with previously set LINUX_KERNEL_RELEASE - if test "${LINUX_DIR}" = "default" ; then - dir="/lib/modules/$LINUX_KERNEL_RELEASE/build"; - AS_TRY_LINUX_DIR([${dir}], [LINUX_DIR=${dir}], ) - fi - - dnl next try using the kernel source dir - if test "${LINUX_DIR}" = "default" ; then - dir="/usr/src/linux-$LINUX_KERNEL_RELEASE"; - AS_TRY_LINUX_DIR([${dir}], [LINUX_DIR=${dir}], ) - fi - - dnl then try a common default of /usr/src/linux - if test "${LINUX_DIR}" = "default" ; then - dir="/usr/src/linux"; - AS_TRY_LINUX_DIR([${dir}], [LINUX_DIR=${dir}], ) - fi - - dnl if still nothing found, fail - if test "${LINUX_DIR}" = "default" ; then - AC_MSG_WARN([Linux source directory not found]) - fi - - AC_SUBST(LINUX_DIR) -]) - -AC_DEFUN([AC_LINUX_SRCARCH],[ - AC_MSG_CHECKING(for linux SRCARCH) - - case "${host}" in - i[[3456]]86-*) LINUX_SRCARCH=x86;; - x86_64-*) LINUX_SRCARCH=x86;; - powerpc*-*) LINUX_SRCARCH=powerpc;; - s390*-*) LINUX_SRCARCH=s390;; - arm*-*) LINUX_SRCARCH=arm;; - mips*-*) LINUX_SRCARCH=mips;; - sparc*-*) LINUX_SRCARCH=sparc;; - *) AC_MSG_ERROR([architecture ${host} not supported]);; - esac - - AC_MSG_RESULT(${LINUX_SRCARCH}) - AC_SUBST(LINUX_SRCARCH) -]) diff --git a/configure.ac b/configure.ac index b103599..526d22d 100644 --- a/configure.ac +++ b/configure.ac @@ -65,13 +65,13 @@ AC_SUBST(LXCROOTFSMOUNT, "${with_rootfs_path}") AC_SUBST(LXCINITDIR, ['${libexecdir}/lxc']) AC_SUBST(LXCTEMPLATEDIR, ['${libdir}/lxc/templates']) -AC_CHECK_HEADERS([linux/netlink.h linux/genetlink.h], +AC_CHECK_HEADERS([linux/unistd.h linux/netlink.h linux/genetlink.h], [], - AC_MSG_ERROR([netlink headers not found. Please install the linux kernel headers.]), + AC_MSG_ERROR([Please install the Linux kernel headers.]), [#include <sys/socket.h> ]) -AC_CHECK_HEADERS([sys/capability.h], [], AC_MSG_ERROR([please install libcap-devel.]), +AC_CHECK_HEADERS([sys/capability.h], [], AC_MSG_ERROR([Please install the libcap development files.]), [#include <sys/types.h> #include <sys/capability.h>]) AC_CHECK_LIB(cap,cap_set_proc,caplib=yes,caplib=no) @@ -91,8 +91,6 @@ AC_CHECK_HEADERS([sys/signalfd.h]) AC_PROG_GCC_TRADITIONAL -AC_LINUX - if test "x$GCC" = "xyes"; then CFLAGS="$CFLAGS -Wall" fi diff --git a/src/lxc/Makefile.am b/src/lxc/Makefile.am index 3a3816e..1c26952 100644 --- a/src/lxc/Makefile.am +++ b/src/lxc/Makefile.am @@ -131,14 +131,3 @@ install-exec-local: install-soPROGRAMS uninstall-local: $(RM) $(DESTDIR)$(libdir)/liblxc.so* - -namespace.c: setns.h - -setns.h: - -$(CC) $(CPPFLAGS) -M -MT$@ $(LINUX_DIR)/arch/$(LINUX_SRCARCH)/include/asm/unistd.h >setns.P - -$(CPP) $(CPPFLAGS) -dM $(LINUX_DIR)/arch/$(LINUX_SRCARCH)/include/asm/unistd.h |grep setns > $@ - -clean-local: - $(RM) setns.h setns.P - --include setns.P diff --git a/src/lxc/attach.c b/src/lxc/attach.c index 33da411..0ca8b39 100644 --- a/src/lxc/attach.c +++ b/src/lxc/attach.c @@ -30,6 +30,7 @@ #include <fcntl.h> #include <sys/param.h> #include <sys/prctl.h> +#include <linux/unistd.h> #if !HAVE_DECL_PR_CAPBSET_DROP #define PR_CAPBSET_DROP 24 @@ -42,8 +43,6 @@ #include "cgroup.h" #include "config.h" -#include "setns.h" - lxc_log_define(lxc_attach, lxc); int setns(int fd, int nstype) -- 1.7.1 ------------------------------------------------------------------------------ Virtualization & Cloud Management Using Capacity Planning Cloud computing makes use of virtualization - but cloud computing also focuses on allowing computing to be delivered as a service. http://www.accelacomm.com/jaw/sfnl/114/51521223/ _______________________________________________ Lxc-devel mailing list Lxc-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/lxc-devel