-
-%************************************************************************
-%* *
-\subsection{System}
-%* *
-%************************************************************************
-
-In GHC prior to 5.01 (or so), on Windows, the implementation
-of "system" in the library System.system does not work for very
-long command lines. But GHC may need to make a system call with
-a very long command line, notably when it links itself during
-bootstrapping.
-
-Solution: import the new definition (which involves compiling up
-lib/std/cbits/system.c)
-
-ToDo: remove when compiling with GHC < 5 is not relevant any more
-
-\begin{code}
-#if defined(mingw32_TARGET_OS) && __GLASGOW_HASKELL__ > 500
--- copied from lib/std/System.lhs
-system cmd =
- withUnsafeCString cmd $ \s -> do
- status <- throwErrnoIfMinus1 "system" (primSystem s)
- case status of
- 0 -> return ExitSuccess
- n -> return (ExitFailure n)
-system "" = ioException (IOError Nothing InvalidArgument "system" "null command" Nothing)
-
-foreign import ccall "systemCmd" unsafe primSystem :: UnsafeCString -> IO Int
-#endif
-\end{code}