-- #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
#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