[Devel] Re: [PATCH user-cr] define MNT_DETACH in older userspace

Serge E. Hallyn serge at hallyn.com
Mon Feb 22 10:03:41 PST 2010


Quoting Nathan Lynch (ntl at pobox.com):
> Thanks, I had already put together a local fix which adds a compat
> header -- please use this instead of duplicating the work across files?
> 
> >From 9d8b8774d4c471f04203b589f49ffe59e1d0cf39 Mon Sep 17 00:00:00 2001
> From: Nathan Lynch <ntl at pobox.com>
> Date: Mon, 22 Feb 2010 11:50:46 -0600
> Subject: [PATCH 1/1] user-cr: add compat.h; define MNT_DETACH
> 
> "nsexec: remount proc and devpts" introduced usage of the MNT_DETACH
> umount2 flag, which is not defined even in some relatively recent
> glibc headers (e.g. Fedora 10/glibc 2.9-3).  Add a compat.h header
> where we can add fixups like this for older build environments.
> 
> Signed-off-by: Nathan Lynch <ntl at pobox.com>

Acked-by: Serge Hallyn <serue at us.ibm.com>

thanks,
-serge

> ---
>  include/compat.h |    7 +++++++
>  nsexec.c         |    1 +
>  restart.c        |    1 +
>  3 files changed, 9 insertions(+), 0 deletions(-)
>  create mode 100644 include/compat.h
> 
> diff --git a/include/compat.h b/include/compat.h
> new file mode 100644
> index 0000000..0d5ade4
> --- /dev/null
> +++ b/include/compat.h
> @@ -0,0 +1,7 @@
> +#ifndef USER_CR_COMPAT_H
> +
> +#ifndef MNT_DETACH
> +#define MNT_DETACH 2
> +#endif
> +
> +#endif /* USER_CR_COMPAT_H */
> diff --git a/nsexec.c b/nsexec.c
> index 7a0294c..1cf9c97 100644
> --- a/nsexec.c
> +++ b/nsexec.c
> @@ -20,6 +20,7 @@
>  #include "clone.h"
>  #include "eclone.h"
>  #include "genstack.h"
> +#include "compat.h"
>  
>  extern pid_t getpgid(pid_t pid);
>  extern pid_t getsid(pid_t pid);
> diff --git a/restart.c b/restart.c
> index 166a499..f5d23bb 100644
> --- a/restart.c
> +++ b/restart.c
> @@ -38,6 +38,7 @@
>  
>  #include "eclone.h"
>  #include "genstack.h"
> +#include "compat.h"
>  
>  static char usage_str[] =
>  "usage: restart [opts]\n"
> -- 
> 1.6.0.6
> 
> 
> 
> _______________________________________________
> Containers mailing list
> Containers at lists.linux-foundation.org
> https://lists.linux-foundation.org/mailman/listinfo/containers
_______________________________________________
Containers mailing list
Containers at lists.linux-foundation.org
https://lists.linux-foundation.org/mailman/listinfo/containers




More information about the Devel mailing list