[CRIU] [PATCH 3/4] zdtm: fix comilation for non-constant PAGE_SIZE

Andrew Vagin avagin at parallels.com
Wed Sep 12 04:02:38 EDT 2012


Acked-by: Andrew Vagin <avagin at parallels.com>

On Wed, Sep 12, 2012 at 11:48:43AM +0400, Konstantin Khlebnikov wrote:
> On some systems PAGE_SIZE is declared as sysconf(_SC_PAGESIZE) in <sys/user.h>
> this is non-constant expression, so it cannot be used in type declarations.
> 
> cc -g -O2 -Wall -Werror -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=0   -c -o ns.o ns.c
> ns.c:124:7: error: variably modified ‘stack’ at file scope
> 
> Signed-off-by: Konstantin Khlebnikov <khlebnikov at openvz.org>
> ---
>  test/zdtm/lib/ns.c |    5 +++--
>  1 file changed, 3 insertions(+), 2 deletions(-)
> 
> diff --git a/test/zdtm/lib/ns.c b/test/zdtm/lib/ns.c
> index 06ba4ce..25f5fd7 100644
> --- a/test/zdtm/lib/ns.c
> +++ b/test/zdtm/lib/ns.c
> @@ -10,7 +10,6 @@
>  #include <sys/wait.h>
>  #include <sys/param.h>
>  #include <sys/mman.h>
> -#include <sys/user.h>
>  #include <fcntl.h>
>  #include <signal.h>
>  #include <sched.h>
> @@ -119,9 +118,11 @@ done:
>  	return 0;
>  }
>  
> +#define NS_STACK_SIZE	4096
> +
>  /* All arguments should be above stack, because it grows down */
>  struct ns_exec_args {
> -	char stack[PAGE_SIZE];
> +	char stack[NS_STACK_SIZE];
>  	char stack_ptr[0];
>  	int argc;
>  	char **argv;
> 
> _______________________________________________
> CRIU mailing list
> CRIU at openvz.org
> https://openvz.org/mailman/listinfo/criu



More information about the CRIU mailing list