
17 Aug
2006
17 Aug
'06
11:01 a.m.
Hi, I would suggest to implement the possiblility to wait for a child/children (non blocking) inside of a SIGCHLD signal handler function. On POSIX the implementation would look like: // while loop inside of signal handling function (SIGCHLD) while ( true) { pid_t pid; int stat = 0, opts = WNOHANG | WUNTRACED; #ifdef WCONTINUED opts |= WCONTINUED; #endif pid = ::waitpid( -1, & stat, opts); if ( pid == 0) break; else if ( pid < 0) throw sys::system_error( sys::error_code( errno, sys::errno_ec) ); child c( pid, status( stat) ); ... } regards, Oliver