Commit cfa21504 authored by Konstantin Khlebnikov's avatar Konstantin Khlebnikov Committed by Pavel Emelyanov

zdtm: fix comilation for non-constant PAGE_SIZE

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: 's avatarKonstantin Khlebnikov <khlebnikov@openvz.org>
Acked-by: 's avatarAndrew Vagin <avagin@parallels.com>
Signed-off-by: 's avatarPavel Emelyanov <xemul@parallels.com>
parent dccb15cc
......@@ -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;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment