2020-05-08 23:50:54 +02:00
|
|
|
#include <setjmp.h>
|
2020-10-10 01:30:52 +02:00
|
|
|
#define __USE_GNU
|
|
|
|
#include <signal.h>
|
|
|
|
#include <stddef.h>
|
2020-05-08 23:50:54 +02:00
|
|
|
|
2020-10-10 01:30:52 +02:00
|
|
|
sigset_t mask;
|
2020-05-08 23:50:54 +02:00
|
|
|
|
2020-10-10 01:30:52 +02:00
|
|
|
void reset_procmask(void) {
|
|
|
|
sigemptyset (&mask);
|
|
|
|
sigaddset (&mask, SIGPROF);
|
|
|
|
sigprocmask(SIG_UNBLOCK, &mask, NULL);
|
2020-05-08 23:50:54 +02:00
|
|
|
}
|
|
|
|
|
2020-10-14 05:30:01 +02:00
|
|
|
int get_fake_if(ucontext_t *ctx) {
|
|
|
|
// we fake IF with id flag
|
|
|
|
return !(ctx->uc_mcontext.__gregs[REG_EFL] & (1 << 21));
|
2020-10-10 01:30:52 +02:00
|
|
|
}
|