crtools uses a parasite code for dumping processes. The parasite code is injected into a process with help PTRACE_SEIZE. Currently crtools blocks signals from a parasite code. If a process has pending signals, crtools wait while a process handles these signals. This method is not suitable for stopped tasks. A stopped task can have a few pending signals, when we will try to execute a parasite code, we will need to drop SIGSTOP, but all other signals must remain pending, because a state of processes must not be changed during checkpointing. This patch adds two ptrace commands to set/get signal-blocked mask. I think gdb can use this commands too. [akpm@linux-foundation.org: be consistent with brace layout] Signed-off-by: Andrey Vagin <avagin@openvz.org> Reviewed-by: Oleg Nesterov <oleg@redhat.com> Cc: Roland McGrath <roland@redhat.com> Cc: Michael Kerrisk <mtk.manpages@gmail.com> Cc: Pavel Emelyanov <xemul@parallels.com> Cc: Cyrill Gorcunov <gorcunov@openvz.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Showing the changes to include/uapi/linux (1 of 2 files). Show all
Unified · Split
| @@ -61,6 +61,9 @@ struct ptrace_peeksiginfo_args { · 60 unmodified lines | |||
| 61 | __s32 nr; /* how may siginfos to take */ | 61 | __s32 nr; /* how may siginfos to take */ |
| 62 | }; | 62 | }; |
| 63 | 63 | ||
| 64 | #define PTRACE_GETSIGMASK 0x420a | ||
| 65 | #define PTRACE_SETSIGMASK 0x420b | ||
| 66 | |||
| 64 | /* Read signals from a shared (process wide) queue */ | 67 | /* Read signals from a shared (process wide) queue */ |
| 65 | #define PTRACE_PEEKSIGINFO_SHARED (1 << 0) | 68 | #define PTRACE_PEEKSIGINFO_SHARED (1 << 0) |
| 66 | 69 | ||