mirror of
https://github.com/checkpoint-restore/criu.git
synced 2026-07-17 16:47:50 +00:00
Helper for si_code event extraction.
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
This commit is contained in:
parent
b749f4b1c3
commit
59a2f13e7e
3 changed files with 5 additions and 3 deletions
|
|
@ -32,6 +32,8 @@
|
|||
#define PTRACE_O_TRACEVFORKDONE 0x00000020
|
||||
#define PTRACE_O_TRACEEXIT 0x00000040
|
||||
|
||||
#define SI_EVENT(_si_code) (((_si_code) & 0xFFFF) >> 8)
|
||||
|
||||
extern int seize_task(pid_t pid, pid_t ppid, pid_t *pgid, pid_t *sid);
|
||||
extern int unseize_task(pid_t pid, int state);
|
||||
extern int ptrace_peek_area(pid_t pid, void *dst, void *addr, long bytes);
|
||||
|
|
|
|||
|
|
@ -171,7 +171,7 @@ retry_signal:
|
|||
goto err;
|
||||
}
|
||||
|
||||
if (((siginfo.si_code & 0xffff) >> 8) != PTRACE_EVENT_STOP)
|
||||
if (SI_EVENT(siginfo.si_code) != PTRACE_EVENT_STOP)
|
||||
goto retry_signal;
|
||||
|
||||
/*
|
||||
|
|
@ -218,7 +218,7 @@ retry_signal:
|
|||
goto err;
|
||||
}
|
||||
|
||||
if (((siginfo.si_code & 0xffff) >> 8) != PTRACE_EVENT_STOP) {
|
||||
if (SI_EVENT(siginfo.si_code) != PTRACE_EVENT_STOP) {
|
||||
pr_err("si_code doesn't match (pid: %d si_code: %d)\n",
|
||||
pid, siginfo.si_code);
|
||||
goto err;
|
||||
|
|
|
|||
2
ptrace.c
2
ptrace.c
|
|
@ -113,7 +113,7 @@ try_again:
|
|||
goto err;
|
||||
}
|
||||
|
||||
if (((si.si_code & 0xffff)>> 8) != PTRACE_EVENT_STOP) {
|
||||
if (SI_EVENT(si.si_code) != PTRACE_EVENT_STOP) {
|
||||
/*
|
||||
* Kernel notifies us about the task being seized received some
|
||||
* event other than the STOP, i.e. -- a signal. Let the task
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue