mirror of
https://github.com/checkpoint-restore/criu
synced 2025-08-30 05:48:05 +00:00
restorer: Implement own BUG_ON_HANDLER
Due to code specifics (we're running without glibc support) we need own one. Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
This commit is contained in:
parent
f5a87742a0
commit
d7ab5f2f7b
@ -311,4 +311,20 @@ static void always_inline rst_mutex_unlock(rst_mutex_t *mutex)
|
|||||||
sys_futex(mutex, FUTEX_WAKE, 1, NULL, NULL, 0);
|
sys_futex(mutex, FUTEX_WAKE, 1, NULL, NULL, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* We need own handler */
|
||||||
|
|
||||||
|
#ifdef BUG_ON_HANDLER
|
||||||
|
# undef BUG_ON_HANDLER
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#define BUG_ON_HANDLER(condition) \
|
||||||
|
do { \
|
||||||
|
if ((condition)) { \
|
||||||
|
long tgid = sys_gettid(); \
|
||||||
|
write_hex_n(0x5a5a5a5a); \
|
||||||
|
write_num_n(__LINE__); \
|
||||||
|
sys_tgkill(tgid, tgid, SIGABRT); \
|
||||||
|
} \
|
||||||
|
} while (0)
|
||||||
|
|
||||||
#endif /* CR_RESTORER_H__ */
|
#endif /* CR_RESTORER_H__ */
|
||||||
|
@ -24,6 +24,7 @@
|
|||||||
#define __NR_exit 60
|
#define __NR_exit 60
|
||||||
#define __NR_flock 73
|
#define __NR_flock 73
|
||||||
#define __NR_unlink 87
|
#define __NR_unlink 87
|
||||||
|
#define __NR_tgkill 131
|
||||||
#define __NR__sysctl 156
|
#define __NR__sysctl 156
|
||||||
#define __NR_prctl 157
|
#define __NR_prctl 157
|
||||||
#define __NR_arch_prctl 158
|
#define __NR_arch_prctl 158
|
||||||
|
@ -279,6 +279,11 @@ static void always_inline local_sleep(long seconds)
|
|||||||
sys_nanosleep(&req, &rem);
|
sys_nanosleep(&req, &rem);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static long always_inline sys_tgkill(long tgid, long pid, int sig)
|
||||||
|
{
|
||||||
|
return syscall3(__NR_tgkill, tgid, pid, (long)sig);
|
||||||
|
}
|
||||||
|
|
||||||
#else /* CONFIG_X86_64 */
|
#else /* CONFIG_X86_64 */
|
||||||
# error x86-32 bit mode not yet implemented
|
# error x86-32 bit mode not yet implemented
|
||||||
#endif /* CONFIG_X86_64 */
|
#endif /* CONFIG_X86_64 */
|
||||||
|
Loading…
x
Reference in New Issue
Block a user