Re: [boost] Presentation of Boost.Process (SoC project)

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

Oliver.Kowalke@qimonda.com wrote:
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) );
Is throwing an exception in a signal handler supported by POSIX ? Davide Bolcioni -- There is no place like /home.

Davide Bolcioni wrote:
Is throwing an exception in a signal handler supported by POSIX ?
No. Additionally, it is also known not to work on a number of systems. Regards, m Send instant messages to your online friends http://au.messenger.yahoo.com
participants (3)
-
Davide Bolcioni
-
Martin Wille
-
Oliver.Kowalke@qimonda.com