2
0
mirror of https://github.com/checkpoint-restore/criu synced 2025-08-31 14:25:49 +00:00

dump, restore: Add blocked signals mask

Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
This commit is contained in:
Cyrill Gorcunov
2011-11-09 00:29:41 +04:00
parent 73e64bec27
commit 0a26593a3b
3 changed files with 28 additions and 2 deletions

View File

@@ -408,7 +408,8 @@ err:
static int get_task_stat(pid_t pid, u8 *comm, u32 *flags,
u64 *start_code, u64 *end_code,
u64 *start_data, u64 *end_data,
u64 *start_stack, u64 *start_brk)
u64 *start_stack, u64 *start_brk,
u64 *task_sigset)
{
FILE *file = NULL;
char *tok1, *tok2;
@@ -502,6 +503,24 @@ static int get_task_stat(pid_t pid, u8 *comm, u32 *flags,
ret = 0;
}
/*
* Now signals.
*/
fclose(file);
file = fopen_proc("%d/status", "r", pid);
if (!file) {
pr_perror("Can't open %d status", pid);
goto err;
}
while (fgets(loc_buf, sizeof(loc_buf), file)) {
if (!strncmp(loc_buf, "SigCgt:", 7)) {
char *end;
*task_sigset = strtol(&loc_buf[8], &end, 16);
break;
}
}
err:
if (file)
fclose(file);
@@ -659,7 +678,8 @@ static int dump_task_core_seized(pid_t pid, struct cr_fdset *cr_fdset)
&core->mm_start_data,
&core->mm_end_data,
&core->mm_start_stack,
&core->mm_start_brk);
&core->mm_start_brk,
&core->task_sigset);
if (ret)
goto err_free;
pr_info("OK\n");

View File

@@ -196,6 +196,7 @@ struct core_entry {
u64 mm_start_stack;
u64 mm_start_brk;
u64 mm_brk;
u64 task_sigset;
};
u8 __core_pad[CKPT_CORE_SIZE];
};

View File

@@ -380,6 +380,11 @@ self_len_end:
goto core_restore_end;
}
/*
* Blocked signals.
*/
rt_sigframe->uc.uc_sigmask.sig[0] = core_entry.task_sigset;
/*
* sigframe is on stack.
*/