+catchJust = Exception.catchIO
+tryJust = Exception.tryIO
+ioErrors = Exception.justIoErrors
+throwTo = Exception.raiseInThread
+#endif
+\end{code}
+
+Standard signal handlers for catching ^C, which just throw an
+exception in the main thread. NOTE: must be called from the main
+thread.
+
+\begin{code}
+installSignalHandlers :: IO ()
+installSignalHandlers = do
+#ifndef mingw32_HOST_OS
+ main_thread <- myThreadId
+ let sig_handler = Catch (throwTo main_thread
+ (Exception.DynException (toDyn Interrupted)))
+ installHandler sigQUIT sig_handler Nothing
+ installHandler sigINT sig_handler Nothing