2
0
mirror of https://github.com/checkpoint-restore/criu synced 2025-08-22 18:07:57 +00:00
criu/compel/include/ptrace.h
Andrei Vagin d7477dac03 compel: set TRACESYSGOOD to distinguish breakpoints from syscalls
When delivering system call traps, set bit 7 in the  signal  number  (i.e.,
deliver SIGTRAP|0x80).  This makes it easy for the tracer  to  distinguish
normal traps from those caused by a system call.

Signed-off-by: Andrei Vagin <avagin@gmail.com>
2023-04-15 21:17:21 -07:00

16 lines
401 B
C

#ifndef COMPEL_PTRACE_H__
#define COMPEL_PTRACE_H__
#include <linux/types.h>
#include <compel/asm/infect-types.h>
#include <compel/ptrace.h>
#define PTRACE_SYSCALL_TRAP 0x80
#define PTRACE_SI_EVENT(_si_code) (((_si_code)&0xFFFF) >> 8)
extern int ptrace_get_regs(pid_t pid, user_regs_struct_t *regs);
extern int ptrace_set_regs(pid_t pid, user_regs_struct_t *regs);
#endif /* COMPEL_PTRACE_H__ */