Skip to content
Snippets Groups Projects
Commit c9a0bf11 authored by Simon Marlow's avatar Simon Marlow
Browse files

elaborate the deprecation messages, and add commented-out new

versions, for setProcessGroupID and createProcessGroup
parent 7b9a915a
No related branches found
No related tags found
No related merge requests found
...@@ -132,6 +132,18 @@ getProcessGroupIDOf pid = ...@@ -132,6 +132,18 @@ getProcessGroupIDOf pid =
foreign import ccall unsafe "getpgid" foreign import ccall unsafe "getpgid"
c_getpgid :: CPid -> IO CPid 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 -- | @'createProcessGroupFor' pid@ calls @setpgid@ to make
-- process @pid@ a new process group leader. -- process @pid@ a new process group leader.
createProcessGroupFor :: ProcessID -> IO ProcessGroupID createProcessGroupFor :: ProcessID -> IO ProcessGroupID
...@@ -145,6 +157,17 @@ joinProcessGroup :: ProcessGroupID -> IO () ...@@ -145,6 +157,17 @@ joinProcessGroup :: ProcessGroupID -> IO ()
joinProcessGroup pgid = joinProcessGroup pgid =
throwErrnoIfMinus1_ "joinProcessGroup" (c_setpgid 0 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 -- | @'setProcessGroupIDOf' pid pgid@ calls @setpgid@ to set the
-- 'ProcessGroupIDOf' for process @pid@ to @pgid@. -- 'ProcessGroupIDOf' for process @pid@ to @pgid@.
setProcessGroupIDOf :: ProcessID -> ProcessGroupID -> IO () setProcessGroupIDOf :: ProcessID -> ProcessGroupID -> IO ()
...@@ -412,7 +435,7 @@ foreign import ccall unsafe "exit" ...@@ -412,7 +435,7 @@ foreign import ccall unsafe "exit"
-- ----------------------------------------------------------------------------- -- -----------------------------------------------------------------------------
-- Deprecated or subject to change -- 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 -- | @'createProcessGroup' pid@ calls @setpgid@ to make
-- process @pid@ a new process group leader. -- process @pid@ a new process group leader.
-- This function is currently deprecated, -- This function is currently deprecated,
...@@ -423,7 +446,7 @@ createProcessGroup pid = do ...@@ -423,7 +446,7 @@ createProcessGroup pid = do
throwErrnoIfMinus1_ "createProcessGroup" (c_setpgid pid 0) throwErrnoIfMinus1_ "createProcessGroup" (c_setpgid pid 0)
return pid 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 -- | @'setProcessGroupID' pid pgid@ calls @setpgid@ to set the
-- 'ProcessGroupID' for process @pid@ to @pgid@. -- 'ProcessGroupID' for process @pid@ to @pgid@.
-- This function is currently deprecated, -- This function is currently deprecated,
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment