Questions tagged [boost-process]

Boost.Process is an accepted C++ library that handles processes in an OS-independent way and will be released with boost 1.64

The developer documentation can be found at http://www.boost.org/doc/libs/develop/doc/html/process.html

104 questions
1
vote
1 answer

boost::process doesn't work in Cygwin

Trying to complie the following code in Cygwin environment: #include int main() { } And get the following error: In file included from /usr/include/boost/process/detail/child_decl.hpp:31:0, from…
Denis
  • 1,167
  • 1
  • 10
  • 30
1
vote
1 answer

How to test an instance counter by asynchronous run of a boost childprocess?

I have tried to use boost::childprocess with an async_pipe as shown in the code example below, while expecting since there is a wait method, that the call to run would not wait for the called executable to finish before continuing to the line where…
1
vote
1 answer

simultaneous read and write to child's stdio using boost.process

i am trying to write and read to child's stdio using boost.process using something like this: boost::asio::io_service writeService, readService; bp::async_pipe in{writeService}; bp::async_pipe out{readService}; bp::child…
unknown.prince
  • 710
  • 6
  • 19
1
vote
1 answer

boost::process::std_out doesn't return because it's trying to open a fifo

When I run this code, the boost::process::std_out > "myfifo" line doesn't return because it's waiting on the open call to return, which it doesn't because "myfifo" is a fifo. Is this a bug? #include int main(int, char**) { …
Mike
  • 693
  • 3
  • 13
1
vote
2 answers

boost process running() and exit_code() thread safety

I am using boost::process::child and boost::process::async_pipe to start an application and read asynchronously (through the means of boost::asio) everything that app outputs on screen whenever this happens. I want to check also if the application…
Abruzzo Forte e Gentile
  • 14,423
  • 28
  • 99
  • 173
1
vote
1 answer

async_read on async_pipe child process giving no data

I have the following code which is simplified from my real code where I am trying to do an async_read on an async_pipe connected to a child process. In the child process I am calling "ls ." as just a test and I want my async read to get the result…
user782220
  • 10,677
  • 21
  • 72
  • 135
1
vote
1 answer

Boost::Process linker error in combination with boost::process::posix::use_vfork

I am toying around with Boost::Process (1.64.0), using GCC 7.1.1, trying to force the use of vfork() when forking a process. I am greeted by a linker error for the following program: #include namespace bp =…
Ton van den Heuvel
  • 10,157
  • 6
  • 43
  • 82
1
vote
2 answers

Race condition in starting up sub processes causes reading from pipe to hang

I have two threads that start up a child process each. The first application is a binary that runs quite long. The second exits quite quickly. There is a race condition that sometimes causes this to fail. Below I have a minimum viable code…
Johan de Vries
  • 175
  • 1
  • 9
1
vote
2 answers

boost::process cannot compile because of boost::throw_exception

When trying to include the boost::process library i get 2 errors relating to boost::process pipe.hpp file with the way it is handling exceptions. '': cannot convert from 'initializer list' to 'boost::system::system_error' |…
Joe Staines
  • 301
  • 1
  • 3
  • 11
1
vote
1 answer

Boost.Process check if process terminated

Is is possible to check if process terminated? I don't want to call .wait(), because it's blocking, and I want to manage a timeout, after which I will terminate the process. Now I have the following code: child c = launch(exec, args, ctx); auto…
fferri
  • 18,285
  • 5
  • 46
  • 95
1
vote
1 answer

Using boost::process 0.5. Can't redirect stdio for python.exe

I'm working some some C++ on Windows that will allow me to launch python.exe (2.7) and interact with it using stdin, stdout, and stderr. I'm using Visual Studio 2015, Boost 1.59, and Boost Process 0.5. I've been successful in launching python.exe…
RyanN
  • 11
  • 1
0
votes
0 answers

Boost child process sticks around after termination

I have a boost::process::child that I terminate by calling the boost::process::child::terminate() function. No errors are thrown. However, if I monitor the active processes using htop or similar process monitor, I still see the child process hanging…
Cecilia
  • 4,512
  • 3
  • 32
  • 75
0
votes
1 answer

boost::process::search_path not finding file

The boost::process::search_path function seems to be unable to find files on some systems. For example, for the following: boost::process::search_path("example.exe"); On some systems, this function will always return an empty string (indicating…
gam03
  • 76
  • 5
0
votes
2 answers

Using boost::process to completely detach a process

I have a systemd service which runs and does its thing. Periodically I need it to upgrade itself, which requires a shutdown and a restart of the service. For question purposes the upgrade script can be as simple as: echo "Stopping…
Addy
  • 2,414
  • 1
  • 23
  • 43
0
votes
0 answers

Building Boost with Process by Conan

I'm using Conan to manage my dependencies; my project requires Process and Interprocess components. How can I add these components to my Boost build with Conan? I'm using Boost 1.75 and Conan 1.44 on Windows 10
SigSegv
  • 11
  • 1