1 {-# OPTIONS -cpp -fffi #-}
2 -----------------------------------------------------------------------------
4 -- Module : System.Process.Internals
5 -- Copyright : (c) The University of Glasgow 2004
6 -- License : BSD-style (see the file libraries/base/LICENSE)
8 -- Maintainer : libraries@haskell.org
9 -- Stability : experimental
10 -- Portability : portable
12 -- Operations for creating and interacting with sub-processes.
14 -----------------------------------------------------------------------------
17 module System.Process.Internals (
18 ProcessHandle(..), PHANDLE, pPrPr_disableITimers, c_execvpe
21 #if !defined(mingw32_TARGET_OS) && !defined(__MINGW32__)
22 import System.Posix.Types ( CPid )
24 import Data.Word ( Word32 )
26 import Foreign.C.String ( CString )
27 import Foreign.C.Types ( CInt )
28 import Foreign.Ptr ( Ptr )
31 {-# CBITS execvpe.c #-}
34 -- ----------------------------------------------------------------------------
37 {- | A handle to a process, which can be used to wait for termination
38 of the process using 'waitForProcess'.
40 None of the process-creation functions in this library wait for
41 termination: they all return a 'ProcessHandle' which may be used
42 to wait for the process later.
44 #if !defined(mingw32_TARGET_OS) && !defined(__MINGW32__)
50 newtype ProcessHandle = ProcessHandle PHANDLE
52 -- ----------------------------------------------------------------------------
54 -- this function disables the itimer, which would otherwise cause confusing
55 -- signals to be sent to the new process.
56 foreign import ccall unsafe "pPrPr_disableITimers"
57 pPrPr_disableITimers :: IO ()
59 foreign import ccall unsafe "execvpe"
60 c_execvpe :: CString -> Ptr CString -> Ptr CString -> IO CInt