Unix Programming - no SIGCHLD generated after stopped child process receives SIGTERM?!

This is Interesting: Free IT Magazines  
Home > Archive > Unix Programming > June 2006 > no SIGCHLD generated after stopped child process receives SIGTERM?!





You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

Author no SIGCHLD generated after stopped child process receives SIGTERM?!
oliver.kowalke@gmx.de

2006-06-26, 7:34 am

Hello,
a parent doesn't get SIGCHLD delivered if one of its child processes
which was stopped before (SIGSTOP) gets an SIGTERM or SIGKILL?!
So I get no information of the termination of a child if it was stopped
before?

regards,
Oliver

code:

void wait_for_child( int signo)
{
pid_t pid;
int stat = 0;
pid = ::waitpid( -1, & stat, WNOHANG | WUNTRACED | WCONTINUED);
if ( pid == 0)
{
// no SIGCHLD for a child delivered
}
else if ( pid < 0)
{
// some error occured
}
...
}

void main()
{
...
struct sigaction act;
act.sa_handler = wait_for_child;
::sigemptyset( & act.sa_mask);
act.sa_flags = 0;
#ifdef SA_RESTART
act.sa_flags |= SA_RESTART;
#endif
if ( ::sigaction( SIGCHLD, & act, 0) < 0)
// some error occured
...
}

Sponsored Links






Free braindumps | Software forum | Database administration forum

Copyright 2003 - 2008 webservertalk.com