This is the mail archive of the
libc-alpha@sources.redhat.com
mailing list for the glibc project.
linux signals
- To: <gcc at gcc dot gnu dot org>
- Subject: linux signals
- From: "Jagadish Chandra Prasad" <jagadish at icmg dot nu>
- Date: Thu, 30 Aug 2001 13:33:19 +0530
- Cc: <gcc at gnu dot org>,<libc-alpha at sources dot redhat dot com>
- References: <10C8636AE359D4119118009027AE99870B5FAFB2@FMSMSX34>
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