[project @ 2000-04-10 14:28:14 by sewardj]
[ghc-hetmet.git] / ghc / lib / std / System.lhs
index ba31873..0404492 100644 (file)
@@ -25,7 +25,7 @@ import Prelude
 import PrelAddr
 import PrelIOBase      ( IOError(..), IOErrorType(..), constructErrorAndFailWithInfo, stToIO )
 import PrelPack        ( unpackCString, unpackCStringST, packString )
-import PrelArr         ( ByteArray )
+import PrelByteArr     ( ByteArray )
 
 type PrimByteArray  = ByteArray Int
 
@@ -188,13 +188,29 @@ unpackProgName argv
 --
 -- Suitable for use with Hugs 98
 -----------------------------------------------------------------------------
+import PrelPrim ( primGetRawArgs
+               , primGetEnv
+               , prelCleanupAfterRunAction
+               , copy_String_to_cstring
+               , readIORef
+               , nh_stderr
+               , nh_stdout
+               , nh_stdin 
+               , nh_exitwith 
+               , nh_flush
+               , nh_close
+               , nh_system
+               , nh_free
+               , nh_getPID
+               )
+
 
 data ExitCode = ExitSuccess | ExitFailure Int
                 deriving (Eq, Ord, Read, Show)
 
 getArgs                     :: IO [String]
 getArgs                      = primGetRawArgs >>= \rawargs ->
-                               return (drop 1 (dropWhile (/= "--") rawargs))
+                               return (tail rawargs)
 
 getProgName                 :: IO String
 getProgName                  = primGetRawArgs >>= \rawargs ->
@@ -217,7 +233,7 @@ fromExitCode (ExitFailure n) = n
 -- see comment in Prelude.hs near primRunIO_hugs_toplevel
 exitWith :: ExitCode -> IO a
 exitWith c
-   = do cleanup_action <- readIORef prelExitWithAction
+   = do cleanup_action <- readIORef prelCleanupAfterRunAction
         case cleanup_action of
            Just xx -> xx
            Nothing -> return ()