Kill a program and its child processes?
Posted: Sat Mar 07, 2015 3:36 am
(Question about Mac OS X)
If I run an external program via RunProgram(), I know I can kill it using KillProgram().
However, if the external program has started its own children processes, is there a way to kill all of them?
I am reading the OS X man pages, and I seem to need a combination of the following:
but I have not figured out any method that works (kills the children processes). Any ideas? 
If I run an external program via RunProgram(), I know I can kill it using KillProgram().
However, if the external program has started its own children processes, is there a way to kill all of them?
I am reading the OS X man pages, and I seem to need a combination of the following:
Code: Select all
pid = ProgramID(Program)
kill(pid, sig)
killpg(pgrp, sig)
SIGTERM (15)
SIGKILL (9)
???