Exports of vg_signals.c
------------------------------------------------------------------ */
-/* Set the standard set of blocked signals, used wheneever we're not
- running a client syscall. */
-extern void VG_(block_signals)(ThreadId tid);
-
/* Highest signal the kernel will let us use */
extern Int VG_(max_signal);
}
}
+/* Set the standard set of blocked signals, used wheneever we're not
+ running a client syscall. */
+static void block_signals(ThreadId tid)
+{
+ vki_sigset_t mask;
+
+ VG_(sigfillset)(&mask);
+
+ /* Don't block these because they're synchronous */
+ VG_(sigdelset)(&mask, VKI_SIGSEGV);
+ VG_(sigdelset)(&mask, VKI_SIGBUS);
+ VG_(sigdelset)(&mask, VKI_SIGFPE);
+ VG_(sigdelset)(&mask, VKI_SIGILL);
+ VG_(sigdelset)(&mask, VKI_SIGTRAP);
+
+ /* Can't block these anyway */
+ VG_(sigdelset)(&mask, VKI_SIGSTOP);
+ VG_(sigdelset)(&mask, VKI_SIGKILL);
+
+ /* Master doesn't block this */
+ if (tid == VG_(master_tid))
+ VG_(sigdelset)(&mask, VKI_SIGVGCHLD);
+
+ VG_(sigprocmask)(VKI_SIG_SETMASK, &mask, NULL);
+}
+
#define SCHEDSETJMP(tid, jumped, stmt) \
do { \
ThreadState * volatile _qq_tst = VG_(get_ThreadState)(tid); \
signal handler to longjmp. */
vg_assert(trc == 0);
trc = VG_TRC_FAULT_SIGNAL;
- VG_(block_signals)(tid);
+ block_signals(tid);
}
done_this_time = (Int)dispatch_ctr_SAVED - (Int)VG_(dispatch_ctr) - 0;
vg_assert(VG_(is_running_thread)(tid));
if (jumped) {
- VG_(block_signals)(tid);
+ block_signals(tid);
VG_(poll_signals)(tid);
}
}
VGP_PUSHCC(VgpSched);
/* set the proper running signal mask */
- VG_(block_signals)(tid);
+ block_signals(tid);
vg_assert(VG_(is_running_thread)(tid));
VG_(restore_all_host_signals)(&saved_mask);
}
-/* Set the standard set of blocked signals, used wheneever we're not
- running a client syscall. */
-void VG_(block_signals)(ThreadId tid)
-{
- vki_sigset_t mask;
-
- VG_(sigfillset)(&mask);
-
- /* Don't block these because they're synchronous */
- VG_(sigdelset)(&mask, VKI_SIGSEGV);
- VG_(sigdelset)(&mask, VKI_SIGBUS);
- VG_(sigdelset)(&mask, VKI_SIGFPE);
- VG_(sigdelset)(&mask, VKI_SIGILL);
- VG_(sigdelset)(&mask, VKI_SIGTRAP);
-
- /* Can't block these anyway */
- VG_(sigdelset)(&mask, VKI_SIGSTOP);
- VG_(sigdelset)(&mask, VKI_SIGKILL);
-
- /* Master doesn't block this */
- if (tid == VG_(master_tid))
- VG_(sigdelset)(&mask, VKI_SIGVGCHLD);
-
- VG_(sigprocmask)(VKI_SIG_SETMASK, &mask, NULL);
-}
-
/* At startup, copy the process' real signal state to the SCSS.
Whilst doing this, block all real signals. Then calculate SKSS and
set the kernel to that. Also initialise DCSS.