boostorg / boostorg/process

"No child processes" error received with boost::process::async_system

Open
#100 4 comments 0 reactions 0 assignees View on GitHub
Dominant language
C++
Stars
145
Forks
151
PR merge metrics
No merged PRs in 30d

Description

Receiving exception "No child processes" when running two boost::process::async_system in a row within a coroutine:
```
#include
#include
#include
#include

int main(int argc, const char** argv) {
std::cout << "starting" << std::endl;
boost::asio::io_service ioService;
boost::asio::spawn(ioService, [&ioService](boost::asio::yield_context yc) {
try {
boost::process::async_system(ioService, yc, "echo hello!1");
boost::process::async_system(ioService, yc, "echo hello!2");
} catch (const std::exception& e) {
std::cout << "error: " << e.what() << std::endl;
}
});
ioService.run();
std::cout << "exiting" << std::endl;
return 0;
}
```
the output is:
```
starting
hello!1
hello!2
error: No child processes
exiting
```
Using boost 1.70.0, running it on Ubuntu 19.04, built it with gcc-8.3.0.
Is there something im doing wrong here?

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.