Error when using `interruptProcessGroupOf` on Mac OS
- Dominant language
- Haskell
- Stars
- 91
- Forks
- 91
- PR merge metrics
- No merged PRs in 30d
Description
Running the code below in Ubuntu I got
```
$ ./Test
The Glorious Glasgow Haskell Compilation System, version 8.0.1
Just ExitSuccess
```
but in Mac OS my student @jonaprieto got
```
$ ./Test
The Glorious Glasgow Haskell Compilation System, version 8.0.1
Test.hs: getProcessGroupIDOf: does not exist (No such process)
```
The error disappears if I replace `interruptProcessGroupOf` by `terminateProcess`.
``` haskell
$ cat Test.hs
module Main where
import Data.Maybe
import System.IO
import System.Process
foo :: IO (ProcessHandle, String)
foo = do
(_, oh, _, ph) <-
createProcess CreateProcess
{ cmdspec = RawCommand "ghc" ["-V"]
, cwd = Nothing
, env = Nothing
, std_in = Inherit
, std_out = CreatePipe
, std_err = Inherit
, close_fds = False
, create_group = True
, delegate_ctlc = False
, create_new_console = False
, detach_console = False
, new_session = False
, child_group = Nothing
, child_user = Nothing
}
o <- hGetContents $ fromMaybe (error "foo") oh
return (ph, o)
main :: IO ()
main = do
(ph, o) <- foo
putStr o
_ <- interruptProcessGroupOf ph
e <- getProcessExitCode ph
print e
```
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.