Boost C++ Libraries Home Libraries People FAQ More

PrevUpHomeNext

Function template system

boost::process::system

Synopsis

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


template<typename... Args> int system(Args &&... args);

Description

Launches a process and waits for its exit. It works as std::system, though it allows all the properties boost.process provides. It will execute the process and wait for it's exit; then return the exit_code.

int ret = system("ls");
[Note] Note

Using this function with synchronous pipes leads to many potential deadlocks.

When using this function with an asynchronous properties and NOT passing an io_context object, the system function will create one and run it. When the io_context is passed to the function, the system function will check if it is active, and call the io_context::run function if not.


PrevUpHomeNext