Boost C++ Libraries Home Libraries People FAQ More

PrevUpHomeNext

Global on_exit

boost::process::on_exit

Synopsis

// In header: <boost/process/async.hpp>

static  on_exit;

Description

When an io_context is passed, the on_exit property can be used, to be notified when the child process exits.

The following syntax is valid

with function being a callable object with the signature (int, const std::error_code&) or an std::future<int>.

Example. 

child 
[Note] Note

The handler is not invoked when the launch fails.

[Warning] Warning

When used ignore_error it might get invoked on error.

[Warning] Warning

on_exit uses boost::asio::signal_set to listen for SIGCHLD on posix, and so has the same restrictions as that class (do not register a handler for SIGCHLD except by using boost::asio::signal_set).


PrevUpHomeNext