[Haskell-cafe] How to terminate the process group of a processcreated with createProcess?

Brandon Allbery allbery.b at gmail.com
Thu Jan 12 17:00:47 CET 2012


On Thu, Jan 12, 2012 at 06:56, André Scholz <andre.scholz at uni-bremen.de>wrote:

>            gid <- createProcessGroup pid
>
> but i get the error message:
> "createProcessGroup: permission denied"
>

It's only going to work on BSDish systems; on systems using the SVID/POSIX
model, only the current process can be converted into a process group
leader, and only if it isn't already one.

I need to go look at the implementation of System.Process, though; the
documentation strongly implies that (a) it already creates a process group,
at least on UNIX (there's an additional step needed to do so on Windows?)
and (b) terminateProcess is claimed to signal the process group, as is
interruptProcessGroupOf (the documentation is clearer here).

[[Having looked:  the documentation for terminateProcess is incorrect and
should not mention process groups, but the documentation for
interruptProcessGroupOf is correct.  Maybe that function will work for
you?]]

In any case, I would not mix System.Process and System.Posix.Process.  I'd
probably use the latter, but that's because it's closer to what I'm used to
as a Unix/SVID/POSIX programmer.

-- 
brandon s allbery                                      allbery.b at gmail.com
wandering unix systems administrator (available)     (412) 475-9364 vm/sms
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.haskell.org/pipermail/haskell-cafe/attachments/20120112/556d66e8/attachment.htm>


More information about the Haskell-Cafe mailing list