aboutsummaryrefslogtreecommitdiffhomepage
path: root/System/Posix/Process.hsc
diff options
context:
space:
mode:
authorGravatar Simon Marlow <marlowsd@gmail.com>2011-05-23 11:30:40 +0100
committerGravatar Simon Marlow <marlowsd@gmail.com>2011-05-23 11:30:40 +0100
commitc9a0bf119ce343b291bef77828066339e94fb64d (patch)
tree8b408d89aba63bdc96bf5d7b2b9e05da701240b9 /System/Posix/Process.hsc
parent7b9a915accc0ec1dbdc785b897273222db7375d0 (diff)
elaborate the deprecation messages, and add commented-out new
versions, for setProcessGroupID and createProcessGroup
Diffstat (limited to 'System/Posix/Process.hsc')
-rw-r--r--System/Posix/Process.hsc27
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@.
+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@.
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@.
-- This function is currently deprecated,