Commit 3ceb96ce authored by Cyrill Gorcunov's avatar Cyrill Gorcunov

dump: Save auxv vector in checkpoint image

Signed-off-by: 's avatarCyrill Gorcunov <gorcunov@openvz.org>
Acked-by: 's avatarPavel Emelyanov <xemul@parallels.com>
parent 415b789c
......@@ -462,6 +462,36 @@ err:
return ret;
}
static int get_task_auxv(pid_t pid, int pid_dir, struct core_entry *core)
{
int fd = open_proc(pid_dir, "auxv");
int ret, i;
if (fd < 0) {
pr_perror("Can't open %d's auxv\n", pid);
return -1;
}
for (i = 0; i < AT_VECTOR_SIZE; i++) {
ret = read(fd, &core->tc.mm_saved_auxv[i],
sizeof(core->tc.mm_saved_auxv[0]));
if (ret == 0)
break;
else if (ret != sizeof(core->tc.mm_saved_auxv[0])) {
ret = -1;
pr_perror("Error readind %d's auxv[%d]\n",
pid, i);
goto err;
}
}
ret = 0;
err:
close_safe(&fd);
return ret;
}
static int get_task_personality(pid_t pid, int pid_dir, u32 *personality)
{
FILE *file = NULL;
......@@ -624,6 +654,12 @@ static int dump_task_core_seized(pid_t pid, int pid_dir, struct proc_pid_stat *s
goto err_free;
pr_info("OK\n");
pr_info("Obtainting task auvx ... ");
ret = get_task_auxv(pid, pid_dir, core);
if (ret)
goto err_free;
pr_info("OK\n");
pr_info("Obtainting task brk ... ");
brk = brk_seized(pid, 0);
if ((long)brk < 0)
......
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