mirror of
https://github.com/checkpoint-restore/criu.git
synced 2026-07-21 01:06:58 +00:00
exec: Initial skeleton
Reserve the cmdline option for this and link empty file. Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
This commit is contained in:
parent
45fdee04fb
commit
4bb4ece76e
4 changed files with 21 additions and 1 deletions
1
Makefile
1
Makefile
|
|
@ -116,6 +116,7 @@ OBJS += signalfd.o
|
|||
OBJS += pstree.o
|
||||
OBJS += protobuf.o
|
||||
OBJS += tty.o
|
||||
OBJS += cr-exec.o
|
||||
|
||||
DEPS := $(patsubst %.o,%.d,$(OBJS))
|
||||
|
||||
|
|
|
|||
10
cr-exec.c
Normal file
10
cr-exec.c
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
#include <unistd.h>
|
||||
#include <string.h>
|
||||
#include "crtools.h"
|
||||
#include "ptrace.h"
|
||||
#include "parasite-syscall.h"
|
||||
|
||||
int cr_exec(int pid, char **opt)
|
||||
{
|
||||
return -1;
|
||||
}
|
||||
10
crtools.c
10
crtools.c
|
|
@ -252,7 +252,8 @@ int main(int argc, char *argv[])
|
|||
if (strcmp(argv[optind], "dump") &&
|
||||
strcmp(argv[optind], "restore") &&
|
||||
strcmp(argv[optind], "show") &&
|
||||
strcmp(argv[optind], "check")) {
|
||||
strcmp(argv[optind], "check") &&
|
||||
strcmp(argv[optind], "exec")) {
|
||||
pr_err("Unknown command %s\n", argv[optind]);
|
||||
goto usage;
|
||||
}
|
||||
|
|
@ -274,6 +275,11 @@ int main(int argc, char *argv[])
|
|||
case 'c':
|
||||
ret = cr_check();
|
||||
break;
|
||||
case 'e':
|
||||
if (!pid)
|
||||
goto opt_pid_missing;
|
||||
ret = cr_exec(pid, argv + optind + 1);
|
||||
break;
|
||||
default:
|
||||
goto usage;
|
||||
break;
|
||||
|
|
@ -287,12 +293,14 @@ usage:
|
|||
pr_msg(" %s restore -t pid [<options>]\n", argv[0]);
|
||||
pr_msg(" %s show (-D dir)|(-f file) [<options>]\n", argv[0]);
|
||||
pr_msg(" %s check\n", argv[0]);
|
||||
pr_msg(" %s exec -t pid <syscall-string>\n", argv[0]);
|
||||
|
||||
pr_msg("\nCommands:\n");
|
||||
pr_msg(" dump checkpoint a process/tree identified by pid\n");
|
||||
pr_msg(" restore restore a process/tree identified by pid\n");
|
||||
pr_msg(" show show dump file(s) contents\n");
|
||||
pr_msg(" check checks whether the kernel support is up-to-date\n");
|
||||
pr_msg(" exec execute a system call by other task\n");
|
||||
|
||||
if (argc < 2) {
|
||||
pr_msg("\nTry -h|--help for more info\n");
|
||||
|
|
|
|||
|
|
@ -196,6 +196,7 @@ int cr_restore_tasks(pid_t pid, struct cr_options *opts);
|
|||
int cr_show(struct cr_options *opts);
|
||||
int convert_to_elf(char *elf_path, int fd_core);
|
||||
int cr_check(void);
|
||||
int cr_exec(int pid, char **opts);
|
||||
|
||||
#define O_DUMP (O_RDWR | O_CREAT | O_EXCL)
|
||||
#define O_SHOW (O_RDONLY)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue