[project @ 2004-12-02 15:57:02 by ross]
[ghc-base.git] / System / Process / Internals.hs
index 09aa376..f53dd5b 100644 (file)
 -- #hide
 module System.Process.Internals (
        ProcessHandle(..), PHANDLE,
+#if !defined(mingw32_TARGET_OS) && !defined(__MINGW32__)
+        pPrPr_disableITimers, c_execvpe
+#endif
   ) where
 
+import Prelude -- necessary to get dependencies right
+
 #if !defined(mingw32_TARGET_OS) && !defined(__MINGW32__)
 import System.Posix.Types ( CPid )
 #else
 import Data.Word ( Word32 )
 #endif
+import Foreign.C.String ( CString )
+import Foreign.C.Types ( CInt )
+import Foreign.Ptr ( Ptr )
+
+#ifdef __HUGS__
+{-# CFILES cbits/execvpe.c  #-}
+#endif
 
 -- ----------------------------------------------------------------------------
 -- ProcessHandle type
@@ -41,3 +53,17 @@ type PHANDLE = Word32
 #endif
 
 newtype ProcessHandle = ProcessHandle PHANDLE
+
+-- ----------------------------------------------------------------------------
+
+#if !defined(mingw32_TARGET_OS) && !defined(__MINGW32__)
+
+-- this function disables the itimer, which would otherwise cause confusing
+-- signals to be sent to the new process.
+foreign import ccall unsafe "pPrPr_disableITimers"
+  pPrPr_disableITimers :: IO ()
+
+foreign import ccall unsafe "execvpe"
+  c_execvpe :: CString -> Ptr CString -> Ptr CString -> IO CInt
+
+#endif