[CRIU] [PATCH] Drop <sys/user.h> to fix PAGE_SIZE declaration

Konstantin Khlebnikov khlebnikov at openvz.org
Mon Apr 16 05:18:38 EDT 2012


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.

This breaks compilation with a very non-obvious error message:

  CC       parasite-syscall.o
In file included from parasite-syscall.c:30:0:
./include/parasite.h:90:8: error: variably modified ‘fds’ at file scope

crtools doesn't uses anything from <sys/user.h>, so we can drop its usage.

Signed-off-by: Konstantin Khlebnikov <khlebnikov at openvz.org>
---
 cr-restore.c                       |    1 -
 parasite-syscall.c                 |    1 -
 test/zdtm/live/transition/fork.c   |    1 -
 test/zdtm/live/transition/ptrace.c |    1 -
 util.c                             |    1 -
 5 files changed, 5 deletions(-)

diff --git a/cr-restore.c b/cr-restore.c
index 9323dad..2df4e0a 100644
--- a/cr-restore.c
+++ b/cr-restore.c
@@ -14,7 +14,6 @@
 #include <sys/mman.h>
 #include <sys/vfs.h>
 #include <sys/ptrace.h>
-#include <sys/user.h>
 #include <sys/wait.h>
 #include <sys/file.h>
 #include <sys/shm.h>
diff --git a/parasite-syscall.c b/parasite-syscall.c
index ebcfc9e..e81fd68 100644
--- a/parasite-syscall.c
+++ b/parasite-syscall.c
@@ -11,7 +11,6 @@
 #include <sys/stat.h>
 #include <fcntl.h>
 #include <sys/mman.h>
-#include <sys/user.h>
 #include <sys/wait.h>
 #include <sys/socket.h>
 
diff --git a/test/zdtm/live/transition/fork.c b/test/zdtm/live/transition/fork.c
index 6ad5899..33bfec0 100644
--- a/test/zdtm/live/transition/fork.c
+++ b/test/zdtm/live/transition/fork.c
@@ -7,7 +7,6 @@
 #include <stdlib.h>
 #include <sys/wait.h>
 #include <sys/mman.h>
-#include <sys/user.h>
 #include <sys/types.h>
 #include <sys/syscall.h>
 
diff --git a/test/zdtm/live/transition/ptrace.c b/test/zdtm/live/transition/ptrace.c
index 1f1cd97..51d15df 100644
--- a/test/zdtm/live/transition/ptrace.c
+++ b/test/zdtm/live/transition/ptrace.c
@@ -7,7 +7,6 @@
 #include <stdlib.h>
 #include <sys/wait.h>
 #include <sys/mman.h>
-#include <sys/user.h>
 #include <sys/types.h>
 #include <sys/syscall.h>
 
diff --git a/util.c b/util.c
index f2626d9..a26ca9a 100644
--- a/util.c
+++ b/util.c
@@ -25,7 +25,6 @@
 #include <sys/mman.h>
 #include <sys/vfs.h>
 #include <sys/ptrace.h>
-#include <sys/user.h>
 #include <sys/wait.h>
 #include <sys/resource.h>
 #include <sys/wait.h>



More information about the CRIU mailing list