2
0
mirror of https://github.com/boostorg/process.git synced 2026-01-28 07:22:30 +00:00

updated examples

This commit is contained in:
klemens-morgenstern
2016-10-23 01:38:14 +02:00
parent 1c0f992721
commit d7ff198dc0
18 changed files with 138 additions and 296 deletions

View File

@@ -9,36 +9,26 @@
#include <boost/process.hpp>
#include <boost/asio.hpp>
#if defined(BOOST_WINDOWS_API)
# include <Windows.h>
#elif defined(BOOST_POSIX_API)
# include <sys/wait.h>
# include <errno.h>
#endif
using namespace boost::process;
namespace bp = boost::process;
int main()
{
{
//[sync
child c("test.exe");
c.wait();
auto exit_code = c.exit_code();
//]
bp::child c("test.exe");
c.wait();
auto exit_code = c.exit_code();
}
{
//[async
boost::asio::io_service io_service;
boost::asio::io_service io_service;
child c(
"test.exe",
io_service,
on_exit([&](int exit, const std::error_code& ec_in){})
);
bp::child c(
"test.exe",
io_service,
bp::on_exit([&](int exit, const std::error_code& ec_in){})
);
io_service.run();
//]
io_service.run();
}
}