[project @ 2004-09-29 15:50:51 by simonmar]
[ghc-base.git] / System / Process / Internals.hs
diff --git a/System/Process/Internals.hs b/System/Process/Internals.hs
new file mode 100644 (file)
index 0000000..09aa376
--- /dev/null
@@ -0,0 +1,43 @@
+{-# OPTIONS -cpp -fffi #-}
+-----------------------------------------------------------------------------
+-- |
+-- Module      :  System.Process.Internals
+-- Copyright   :  (c) The University of Glasgow 2004
+-- License     :  BSD-style (see the file libraries/base/LICENSE)
+-- 
+-- Maintainer  :  libraries@haskell.org
+-- Stability   :  experimental
+-- Portability :  portable
+--
+-- Operations for creating and interacting with sub-processes.
+--
+-----------------------------------------------------------------------------
+
+-- #hide
+module System.Process.Internals (
+       ProcessHandle(..), PHANDLE,
+  ) where
+
+#if !defined(mingw32_TARGET_OS) && !defined(__MINGW32__)
+import System.Posix.Types ( CPid )
+#else
+import Data.Word ( Word32 )
+#endif
+
+-- ----------------------------------------------------------------------------
+-- ProcessHandle type
+
+{- | A handle to a process, which can be used to wait for termination
+     of the process using 'waitForProcess'.
+
+     None of the process-creation functions in this library wait for
+     termination: they all return a 'ProcessHandle' which may be used
+     to wait for the process later.
+-}
+#if !defined(mingw32_TARGET_OS) && !defined(__MINGW32__)
+type PHANDLE = CPid
+#else
+type PHANDLE = Word32
+#endif
+
+newtype ProcessHandle = ProcessHandle PHANDLE