+/* At the toplevel repl we routinely call this function. The signal
+ * mask ought to be clear anyway most of the time, but may be non-zero
+ * if we were interrupted e.g. while waiting for a queue. */
+
+#if 1
+void reset_signal_mask ()
+{
+ sigset_t new;
+ sigemptyset(&new);
+ sigprocmask(SIG_SETMASK,&new,0);
+}
+#else
+void reset_signal_mask ()
+{
+ sigset_t new,old;
+ int i;
+ int wrong=0;
+ sigemptyset(&new);
+ sigprocmask(SIG_SETMASK,&new,&old);
+ for(i=1; i<NSIG; i++) {
+ if(sigismember(&old,i)) {
+ fprintf(stderr,
+ "Warning: signal %d is masked: this is unexpected\n",i);
+ wrong=1;
+ }
+ }
+ if(wrong)
+ fprintf(stderr,"If this version of SBCL is less than three months old, please report this.\nOtherwise, please try a newer version first\n. Reset signal mask.\n");
+}
+#endif
+
+
+