Re: Killing process started by system()?
- From: Josef Moellers <josef.moellers@xxxxxxxxxxxxxxxxxxx>
- Date: Thu, 28 Sep 2006 10:42:31 +0200
carsonbj@xxxxxxxxx wrote:
Is there anyway to kill a process that has been started by the system()
function?
At the bottom, all processes will be created using the same mechansim: a fork()(or newer: clone()?) system call. There is no difference between you typing "ls" at the shell prompt and your program executing "system("ls");". AAMOF: "system() executes a command specified in string by calling /bin/sh -c string" (from "man 3 system").
So, you can just "kill <pid>" or "kill -9 <pid>" to kill that process.
If you can't, then there must be another reason, not related to the fact that the process was started using system(3), e.g. the process hangs in D state or it's not running under your UID. See the output of ps.
--
Josef Möllers (Pinguinpfleger bei FSC)
If failure had no penalty success would not be a prize
-- T. Pratchett
.
- References:
- Killing process started by system()?
- From: carsonbj@xxxxxxxxx
- Killing process started by system()?
- Prev by Date: Re: Preemptive linux
- Next by Date: test :)
- Previous by thread: Re: Killing process started by system()?
- Next by thread: Re: Killing process started by system()?
- Index(es):