When "make test" is executed, CFLAGS is exported from the root Makefile.
These flags define _GNU_SOURCE, so we don't need to define it in the
souce file.
In addition unistd.h isn't included, so a few functions are shown as undeclared.
make zdtm_ns
make[3]: Entering directory `/root/criu/test'
gcc -O2 -Wall -Werror -DCONFIG_X86_64 -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE zdtm_ct.c -o zdtm_ct
zdtm_ct.c:1:0: error: "_GNU_SOURCE" redefined [-Werror]
#define _GNU_SOURCE
^
<command-line>:0:0: note: this is the location of the previous definition
zdtm_ct.c: In function ‘main’:
zdtm_ct.c:21:2: error: implicit declaration of function ‘fork’ [-Werror=implicit-function-declaration]
pid = fork();
^
zdtm_ct.c:23:3: error: implicit declaration of function ‘setsid’ [-Werror=implicit-function-declaration]
if (setsid() == -1) {
^
zdtm_ct.c:49:3: error: implicit declaration of function ‘execv’ [-Werror=implicit-function-declaration]
execv(argv[1], argv + 1);
^
zdtm_ct.c:62:3: error: implicit declaration of function ‘getpid’ [-Werror=implicit-function-declaration]
kill(getpid(), WTERMSIG(status));
^
cc1: all warnings being treated as errors
Signed-off-by: Andrey Vagin <avagin@openvz.org>
Tested-by: Ruslan Kuprieiev <kupruser@gmail.com>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
criu
====
An utility to checkpoint/restore tasks. Using this tool, you can
freeze a running application (or part of it) and checkpoint it to
a hard drive as a collection of files. You can then use the files
to restore and run the application from the point it was frozen
at. The distinctive feature of the CRIU project is that it is
mainly implemented in user space.
The project home is at http://criu.org
Pages worth starting with are
* Kernel configuration, compilation, etc: http://criu.org/Installation
* A simple example of usage: http://criu.org/Simple_loop
* More sophisticated example with graphical app: http://criu.org/VNC