shithub: MicroHs

ref: 9a777dd4c3dfbb22fde0afee15cba74a48a13b4f
dir: /lib/System/Cmd.hs/

View raw version
module System.Cmd(system) where
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