[lxc-devel] [PATCH] define PR_SET_MM_MAP & friends if necessary
Stéphane Graber
stgraber at ubuntu.com
Fri Nov 6 21:07:55 UTC 2015
On Fri, Nov 06, 2015 at 01:50:33PM -0700, Tycho Andersen wrote:
> PR_SET_MM_MAP only went in to the kernel at 3.18 (or 3.19), so we need to
> define these for kernels before then. If there was an error, the code
> simply logs the failure and continues on.
>
> Also, we can drop the PR_SET_MM_otherstuff contstants since those were
> dropped in 93525c00c76b2804c46cf3c275d610ebe71cb4be.
>
> Signed-off-by: Tycho Andersen <tycho.andersen at canonical.com>
Acked-by: Stéphane Graber <stgraber at ubuntu.com>
> ---
> src/lxc/utils.c | 33 +++++++++++++++++++--------------
> 1 file changed, 19 insertions(+), 14 deletions(-)
>
> diff --git a/src/lxc/utils.c b/src/lxc/utils.c
> index d592243..d9e769d 100644
> --- a/src/lxc/utils.c
> +++ b/src/lxc/utils.c
> @@ -51,20 +51,25 @@
> #define PR_SET_MM 35
> #endif
>
> -#ifndef PR_SET_MM_ARG_START
> -#define PR_SET_MM_ARG_START 8
> -#endif
> -
> -#ifndef PR_SET_MM_ARG_END
> -#define PR_SET_MM_ARG_END 9
> -#endif
> -
> -#ifndef PR_SET_MM_ENV_START
> -#define PR_SET_MM_ENV_START 10
> -#endif
> -
> -#ifndef PR_SET_MM_ENV_END
> -#define PR_SET_MM_ENV_END 11
> +#ifndef PR_SET_MM_MAP
> +#define PR_SET_MM_MAP 14
> +
> +struct prctl_mm_map {
> + uint64_t start_code;
> + uint64_t end_code;
> + uint64_t start_data;
> + uint64_t end_data;
> + uint64_t start_brk;
> + uint64_t brk;
> + uint64_t start_stack;
> + uint64_t arg_start;
> + uint64_t arg_end;
> + uint64_t env_start;
> + uint64_t env_end;
> + uint64_t *auxv;
> + uint32_t auxv_size;
> + uint32_t exe_fd;
> +};
> #endif
>
> #ifndef O_PATH
> --
> 2.6.2
>
> _______________________________________________
> lxc-devel mailing list
> lxc-devel at lists.linuxcontainers.org
> http://lists.linuxcontainers.org/listinfo/lxc-devel
--
Stéphane Graber
Ubuntu developer
http://www.ubuntu.com
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: Digital signature
URL: <http://lists.linuxcontainers.org/pipermail/lxc-devel/attachments/20151106/0427722a/attachment.sig>
More information about the lxc-devel
mailing list