[commit: unix] master: elaborate the deprecation messages, and add commented-out new (c9a0bf1)
Simon Marlow
marlowsd at gmail.com
Tue May 24 15:50:52 CEST 2011
Repository : ssh://darcs.haskell.org//srv/darcs/packages/unix
On branch : master
http://hackage.haskell.org/trac/ghc/changeset/c9a0bf119ce343b291bef77828066339e94fb64d
>---------------------------------------------------------------
commit c9a0bf119ce343b291bef77828066339e94fb64d
Author: Simon Marlow <marlowsd at gmail.com>
Date: Mon May 23 11:30:40 2011 +0100
elaborate the deprecation messages, and add commented-out new
versions, for setProcessGroupID and createProcessGroup
>---------------------------------------------------------------
System/Posix/Process.hsc | 27 +++++++++++++++++++++++++--
1 files changed, 25 insertions(+), 2 deletions(-)
diff --git a/System/Posix/Process.hsc b/System/Posix/Process.hsc
index e42884f..d97b81a 100644
--- a/System/Posix/Process.hsc
+++ b/System/Posix/Process.hsc
@@ -132,6 +132,18 @@ getProcessGroupIDOf pid =
foreign import ccall unsafe "getpgid"
c_getpgid :: CPid -> IO CPid
+{-
+ To be added in the future, after the deprecation period for the
+ existing createProcessGroup has elapsed:
+
+-- | 'createProcessGroup' calls @setpgid(0,0)@ to make
+-- the current process a new process group leader.
+createProcessGroup :: IO ProcessGroupID
+createProcessGroup pid = do
+ throwErrnoIfMinus1_ "createProcessGroupFor" (c_setpgid 0 0)
+ return pid
+-}
+
-- | @'createProcessGroupFor' pid@ calls @setpgid@ to make
-- process @pid@ a new process group leader.
createProcessGroupFor :: ProcessID -> IO ProcessGroupID
@@ -145,6 +157,17 @@ joinProcessGroup :: ProcessGroupID -> IO ()
joinProcessGroup pgid =
throwErrnoIfMinus1_ "joinProcessGroup" (c_setpgid 0 pgid)
+{-
+ To be added in the future, after the deprecation period for the
+ existing setProcessGroupID has elapsed:
+
+-- | @'setProcessGroupID' pgid@ calls @setpgid@ to set the
+-- 'ProcessGroupID' of the current process to @pgid at .
+setProcessGroupID :: ProcessGroupID -> IO ()
+setProcessGroupID pid pgid =
+ throwErrnoIfMinus1_ "setProcessGroupIDOf" (c_setpgid pid pgid)
+-}
+
-- | @'setProcessGroupIDOf' pid pgid@ calls @setpgid@ to set the
-- 'ProcessGroupIDOf' for process @pid@ to @pgid at .
setProcessGroupIDOf :: ProcessID -> ProcessGroupID -> IO ()
@@ -412,7 +435,7 @@ foreign import ccall unsafe "exit"
-- -----------------------------------------------------------------------------
-- Deprecated or subject to change
-{-# DEPRECATED createProcessGroup "This function is subject to change in future versions." #-}
+{-# DEPRECATED createProcessGroup "This function is scheduled to be replaced by something different in the future, we therefore recommend that you do not use this version and use createProcessGroupFor instead." #-}
-- | @'createProcessGroup' pid@ calls @setpgid@ to make
-- process @pid@ a new process group leader.
-- This function is currently deprecated,
@@ -423,7 +446,7 @@ createProcessGroup pid = do
throwErrnoIfMinus1_ "createProcessGroup" (c_setpgid pid 0)
return pid
-{-# DEPRECATED setProcessGroupID "This function is subject to change in future versions." #-}
+{-# DEPRECATED setProcessGroupID "This function is scheduled to be replaced by something different in the future, we therefore recommend that you do not use this version and use setProcessGroupIdOf instead." #-}
-- | @'setProcessGroupID' pid pgid@ calls @setpgid@ to set the
-- 'ProcessGroupID' for process @pid@ to @pgid at .
-- This function is currently deprecated,
More information about the Cvs-libraries
mailing list