This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

linux signals


Hi,
    I have problem while using linux signals.some signals are lost.
    I have a signal handler for SIGCHLD.
    my signal handler code is.,

   void handler(int i)


     cout<<"Inside Handler:"<<getpid()<<":"<<i<<endl;
     int status;
     pid_t pid=wait(&status);
    if(pid >0 ){
    cout<<"Child:"<<pid<<" exited with :"<<status<<endl;
    }
}

  I am initialising signal handler as.,

  struct sigaction sa;
  sigemptyset( &sa.sa_mask );
  sa.sa_flags = 0;
  sa.sa_handler = handler;
  sigaction( SIGCHLD, &sa, 0 );


i have some 10 child processes running. i am issuing SIGTERM  on all child
processes at a time using killall.
but handler is not called for 10 times.
some child processes are becoming  <defunct>.

i am using glibc 2.1.3 and kernel 2.2.14
can someone explain whats happenning.

Regards,
Jagadish


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]