[project @ 2004-10-09 07:51:06 by panne]
authorpanne <unknown>
Sat, 9 Oct 2004 07:51:06 +0000 (07:51 +0000)
committerpanne <unknown>
Sat, 9 Oct 2004 07:51:06 +0000 (07:51 +0000)
Unbreak Hugs by moving pPrPr_disableITimers and execvpe to System.Posix.Internals
(base package) and use it from System.Posix.Process (unix package).

System/Process/Internals.hs

index 09aa376..eb16d36 100644 (file)
@@ -15,7 +15,7 @@
 
 -- #hide
 module System.Process.Internals (
-       ProcessHandle(..), PHANDLE,
+       ProcessHandle(..), PHANDLE, pPrPr_disableITimers, c_execvpe
   ) where
 
 #if !defined(mingw32_TARGET_OS) && !defined(__MINGW32__)
@@ -23,6 +23,13 @@ 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__
+{-# CBITS execvpe.c  #-}
+#endif
 
 -- ----------------------------------------------------------------------------
 -- ProcessHandle type
@@ -41,3 +48,13 @@ type PHANDLE = Word32
 #endif
 
 newtype ProcessHandle = ProcessHandle PHANDLE
+
+-- ----------------------------------------------------------------------------
+
+-- 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