Thread: child process

  1. #1
    Unregistered
    Guest

    Lightbulb child process

    I have a child process running in the background it is created from the main program with the command

    system("./habbit&");

    How do I kill the child process without killing the main program?
    Is there a command for doing this or some function?

    If I use the fork command it freezes the main program.

    Thanks...

  2. #2
    ATH0 quzah's Avatar
    Join Date
    Oct 2001
    Posts
    14,826
    "man kill"

    Quzah.
    Hope is the first step on the road to disappointment.

  3. #3
    and the hat of int overfl Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    39,659

  4. #4
    Unregistered
    Guest
    ok I use kill, but I cannot retrieve the child PID from within the main program to kill the child process. Therefore if I kil anything it will kill the main program and the child program. I am using a unix platform. help.

    Thanks

  5. #5
    Unregistered
    Guest

    Cool

    Ok I don't know why i did not think of this eariler. But, I just placed an "getpid" in the child program and returned it to temp file, then I read it into the main program and finally used a keyboard command to execute the kill for the child. Now I can start and kill a child process at will thanks guys.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. init adopts zombie process?
    By password636 in forum Linux Programming
    Replies: 4
    Last Post: 07-01-2009, 10:05 AM
  2. inter process communcation, parent - child
    By tallan in forum C Programming
    Replies: 5
    Last Post: 02-28-2009, 04:04 AM
  3. create a child process that creates a child process
    By cus in forum Linux Programming
    Replies: 9
    Last Post: 01-13-2009, 02:14 PM
  4. Replies: 3
    Last Post: 10-15-2008, 09:24 AM
  5. process programming
    By St0rM-MaN in forum Linux Programming
    Replies: 2
    Last Post: 09-15-2007, 07:53 AM