{-# LANGUAGE ForeignFunctionInterface #-} {-# INCLUDE #-} module Esotericbot.Chroot where import Foreign.C import Foreign foreign import ccall unsafe "chroot" c_chroot :: CString -> IO CInt chroot s = do cs <- newCString s i <- c_chroot cs if i < 0 then error $ "Chroot to " ++ s ++ " failed!" else return ( ) free cs