shithub: MicroHs

ref: ffda7053c7418a374fe16ed1c7da8a024cfe7523
dir: /lib/System/Cmd.hs/

View raw version
module System.Cmd(system) where
import Prelude(); import MiniPrelude
import Foreign.C.String
import System.Exit

foreign import ccall "system" c_system :: CString -> IO Int

system :: String -> IO ExitCode
system s = do
  r <- withCAString s c_system
  return $ if r == 0 then ExitSuccess else ExitFailure r