Thread: how to catch child program using signals

  1. #1
    Registered User
    Join Date
    Nov 2007
    Posts
    32

    how to catch child program using signals

    Hello All,


    I have a program(process) creating a new process after a long run with the PPID of my program(even name was same).

    Can I catch this child program using signal handlers?

    What all the possible reasons for the same situation ?


    Thanks in advance
    Ashok

  2. #2
    spurious conceit MK27's Avatar
    Join Date
    Jul 2008
    Location
    segmentation fault
    Posts
    8,300
    Quote Originally Posted by ashok449 View Post
    I have a program(process) creating a new process after a long run with the PPID of my program(even name was same).
    I am not the expert but I believe the ONLY reason for this to occur is if you are using fork() or threads. Are you (or are you using a library which does?)
    C programming resources:
    GNU C Function and Macro Index -- glibc reference manual
    The C Book -- nice online learner guide
    Current ISO draft standard
    CCAN -- new CPAN like open source library repository
    3 (different) GNU debugger tutorials: #1 -- #2 -- #3
    cpwiki -- our wiki on sourceforge

  3. #3
    Registered User
    Join Date
    Nov 2007
    Posts
    32
    Actually I have a main program, that creates a Thread, because of unknown reasons the thread is creating another thread (extra) (extra Thread has the Ppid of the earlier thread)

    I'm not using any fork() system call here.

    Environment ---- architecture: powerpc Linux kernel : 2.4


    I really have no clue why this happening, and not able to reproduce it.
    Its happening after a long run of the program.


    what might be the reason?


    Thanks

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Client-server system with input from separate program
    By robot-ic in forum Networking/Device Communication
    Replies: 3
    Last Post: 01-16-2009, 03:30 PM
  2. 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
  3. Need help with my program...
    By Noah in forum C Programming
    Replies: 2
    Last Post: 03-11-2006, 07:49 PM
  4. I need some help with my program please.
    By agentxx04 in forum C Programming
    Replies: 9
    Last Post: 09-26-2004, 07:51 AM
  5. My program, anyhelp
    By @licomb in forum C Programming
    Replies: 14
    Last Post: 08-14-2001, 10:04 PM