
On Sun, 19 Aug 2012 20:36:38 +0200, Roland Bock <rbock@eudoxos.de> wrote:
Something like (assuming the design I suggested and assuming the cleanup would be optional- would it be?):
child_process cp( cmd_line("test --foo /bar"), auto_cleanup() );
The work would then be done in the constructor with posix implementation, in destructor in windows. Calling the signal function in the constructor might be a bit strange since it sets the signal handler for SIGCHLD in general, not just for
[...] this specific child process. That's why I suggested a method that sets
Yes, Roland highlights a problem with signals. As signal handlers are set globally in an application, libraries can't assume they can do what they want. So I rather let the application developer handle signals explicitly - he is the only one who can do it right. It's a pity as that means you have to deal with a platform-specific concept (and maybe even code). But then I personally think it's not a big problem. It's just a matter of fact that platforms can be unfortunately very different. Boris