From: Stéphane Graber Date: Sun, 11 Oct 2015 17:07:52 +0000 (-0400) Subject: Attempt to fix bionic builds of unmount-namespace X-Git-Tag: lxc-2.0.0.beta1~93 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=97272aec0fd981ebacda1cf1fe0dd2d93f19b0a9;p=thirdparty%2Flxc.git Attempt to fix bionic builds of unmount-namespace Signed-off-by: Stéphane Graber --- diff --git a/hooks/unmount-namespace.c b/hooks/unmount-namespace.c index 488c9ccc8..86513ac9b 100644 --- a/hooks/unmount-namespace.c +++ b/hooks/unmount-namespace.c @@ -38,6 +38,33 @@ #include /* getmntent, endmntent */ #include /* errno */ +#include <../src/config.h> + +#if IS_BIONIC +#include <../src/include/lxcmntent.h> +#else +#include +#endif + +#ifndef O_PATH +#define O_PATH 010000000 +#endif + +/* Define setns() if missing from the C library */ +#ifndef HAVE_SETNS +static inline int setns(int fd, int nstype) +{ +#ifdef __NR_setns + return syscall(__NR_setns, fd, nstype); +#elif defined(__NR_set_ns) + return syscall(__NR_set_ns, fd, nstype); +#else + errno = ENOSYS; + return -1; +#endif +} +#endif + struct mount { char *src; /* currently not used */ char *dst;