
On 11.01.2012 at 23:08 Donn Cave wrote:
Quoth Brandon Allbery
, ... terminateProcess passes on the semantics of kill(2); on SVID-compliant (and I think POSIX.1-compliant) systems, the negative of the process group leader's process ID is used to signal the process group. Note that you may need to arrange for your initial child process to invoke setpgrp() to insure that the parent program is not part of the process group.
... and that stuff can be found in System.Posix.Process. Support for POSIX killpg can be found in System.Posix.Signals, by the way in case you think that would make your intention more transparent.
I tried: import System.Posix.Process import System.Posix.Signals import System.Process import System.Process.Internals terminateProcessGroup :: ProcessHandle -> IO () terminateProcessGroup ph = do let (ProcessHandle pmvar) = ph ph_ <- readMVar pmvar case ph_ of OpenHandle pid -> do -- pid is a POSIX pid gid <- createProcessGroup pid signalProcessGroup 15 pid otherwise -> error "Somethings wrong." but i get the error message: "createProcessGroup: permission denied" Is there a way around this permission problem? Kind regards, André