[project @ 1999-07-03 18:43:46 by sof]
authorsof <unknown>
Sat, 3 Jul 1999 18:43:46 +0000 (18:43 +0000)
committersof <unknown>
Sat, 3 Jul 1999 18:43:46 +0000 (18:43 +0000)
exitWith: don't call exit(), but use the RTS' shutdownHaskellAndExit()

ghc/lib/std/System.lhs

index 0b01d5a..f61bf96 100644 (file)
@@ -5,7 +5,7 @@
 \section[System]{Module @System@}
 
 \begin{code}
-{-# OPTIONS -#include "cbits/stgio.h" #-}
+{-# OPTIONS -#include "cbits/stgio.h" -#include "RtsAPI.h" #-}
 module System 
     ( 
       ExitCode(ExitSuccess,ExitFailure)
@@ -142,7 +142,7 @@ exitWith (ExitFailure n)
     primExit n
     ioError (IOError Nothing OtherError "exitWith" "exit should not return")
 
-foreign import ccall "libHS_cbits.so" "exit" unsafe primExit :: Int -> IO ()
+foreign import ccall "shutdownHaskellAndExit" primExit :: Int -> IO ()
 
 exitFailure :: IO a
 exitFailure = exitWith (ExitFailure 1)