[project @ 2001-05-03 08:10:09 by simonpj]
[ghc-hetmet.git] / ghc / rts / Signals.c
index ee5ef81..037e427 100644 (file)
@@ -1,5 +1,5 @@
 /* -----------------------------------------------------------------------------
- * $Id: Signals.c,v 1.17 2000/04/14 16:47:43 panne Exp $
+ * $Id: Signals.c,v 1.19 2001/01/24 15:38:14 simonmar Exp $
  *
  * (c) The GHC Team, 1998-1999
  *
@@ -7,6 +7,8 @@
  *
  * ---------------------------------------------------------------------------*/
 
+#define NON_POSIX_SOURCE
+
 #include "Rts.h"
 #include "SchedAPI.h"
 #include "Schedule.h"
@@ -144,7 +146,7 @@ unblockUserSignals(void)
    -------------------------------------------------------------------------- */
 
 StgInt 
-sig_install(StgInt sig, StgInt spi, StgStablePtr handler, sigset_t *mask)
+stg_sig_install(StgInt sig, StgInt spi, StgStablePtr handler, sigset_t *mask)
 {
     sigset_t signals;
     struct sigaction action;
@@ -180,7 +182,7 @@ sig_install(StgInt sig, StgInt spi, StgStablePtr handler, sigset_t *mask)
        break;
 
     default:
-        barf("sig_install: bad spi");
+        barf("stg_sig_install: bad spi");
     }
 
     if (mask != 0)
@@ -228,7 +230,7 @@ start_signal_handlers(void)
 
 #else /* PAR */
 StgInt 
-sig_install(StgInt sig, StgInt spi, StgStablePtr handler, sigset_t *mask)
+stg_sig_install(StgInt sig, StgInt spi, StgStablePtr handler, sigset_t *mask)
 {
   /* don't fflush(stdout); WORKAROUND bug in Linux glibc */
   barf("no signal handling support in a parallel implementation");
@@ -299,6 +301,8 @@ init_default_handlers()
       /* Oh well, at least we tried. */
       prog_belch("failed to install SIGINT handler");
     }
+
+    siginterrupt(SIGINT, 1);
 }
 
 #endif /*! mingw32_TARGET_OS */