The inner launcher to be used

typename ...
Utility class to bind initializers to a launcher.

This can be used when multiple processes shared some settings, e.g.

auto typename ... `ExecutionContext &` `const typename std::enable_if< std::is_convertible< ExecutionContext &, boost::asio::execution_context & >::value, filesystem::path >::type &` `Args &&` `Inits &&...`
auto typename ... `ExecutionContext &` `error_code &` `const typename std::enable_if< std::is_convertible< ExecutionContext &, boost::asio::execution_context & >::value, filesystem::path >::type &` `Args &&` `Inits &&...`
auto typename ... `Executor` `const typename std::enable_if< boost::asio::execution::is_executor< Executor >::value||boost::asio::is_executor< Executor >::value, filesystem::path >::type &` `Args &&` `Inits &&...`
auto typename ... `Executor` `error_code &` `const typename std::enable_if< boost::asio::execution::is_executor< Executor >::value||boost::asio::is_executor< Executor >::value, filesystem::path >::type &` `Args &&` `Inits &&...`
typename ...
Launcher_ &&
Init_ &&...
auto std::size_t ... typename ... `unspecified` `ExecutionContext &` `const typename std::enable_if< std::is_convertible< ExecutionContext &, boost::asio::execution_context & >::value, filesystem::path >::type &` `Args &&` `Inits &&...`
auto std::size_t ... typename ... `unspecified` `ExecutionContext &` `error_code &` `const typename std::enable_if< std::is_convertible< ExecutionContext &, boost::asio::execution_context & >::value, filesystem::path >::type &` `Args &&` `Inits &&...`
auto std::size_t ... typename ... `unspecified` `Executor` `const typename std::enable_if< boost::asio::execution::is_executor< Executor >::value||boost::asio::is_executor< Executor >::value, filesystem::path >::type &` `Args &&` `Inits &&...`
auto std::size_t ... typename ... `unspecified` `Executor` `error_code &` `const typename std::enable_if< boost::asio::execution::is_executor< Executor >::value||boost::asio::is_executor< Executor >::value, filesystem::path >::type &` `Args &&` `Inits &&...`
auto typename ... `Launcher &&` `Init &&...`
auto typename ... `Init &&...`
std::char_traits<CharT>
Small wrapper for a null-terminated string that can be directly passed to C APIS.

This ref can only be modified by moving the front pointer. It does not store the size, but can detect values that can directly be passed to system APIs.

It can be constructed from a `char*` pointer or any class that has a `c_str()` member function, e.g. std::string or boost::static_string.

CharT
Traits
basic_string_view< value_type, Traits >
CharT *
const CharT *
CharT &
const CharT &
const_pointer
const_iterator
typename std::reverse_iterator< const_iterator >
typename std::reverse_iterator< iterator >
std::size_t
std::ptrdiff_t
constexpr size_type
constexpr basic_string_view< value_type, Traits >::const_pointer
constexpr
constexpr const_iterator
constexpr const_iterator
constexpr const_iterator
constexpr const_iterator
constexpr const_reverse_iterator
constexpr const_reverse_iterator
constexpr const_reverse_iterator
constexpr const_reverse_iterator
constexpr size_type
constexpr size_type
constexpr size_type
constexpr bool
constexpr const_reference `size_type`
constexpr const_reference `size_type`
constexpr const_reference
constexpr const_reference
constexpr const_pointer
constexpr void `size_type`
void ``basic_cstring_ref` &`
size_type `value_type *` `size_type` `size_type0`
constexpr `basic_cstring_ref` `size_type0`
constexpr string_view_type `size_type` `size_type`
constexpr int ``basic_cstring_ref``
constexpr bool `string_view_type`
constexpr bool `value_type`
constexpr size_type `CharT` `size_type0`
void
std::basic_string< value_type, traits_type >
std::basic_string< value_type, traits_type, Allocator > `const Allocator &`
std::nullptr_t
const value_type *
typename std::enable_if< std::is_same<const value_type, typename std::remove_pointer<decltype(std::declval<Source>().c_str())>::type >::value
::type
Source &&
constexpr const_pointer
`basic_cstring_ref`< char >
`basic_cstring_ref`< wchar_t >
`basic_cstring_ref`< char16_t >
`basic_cstring_ref`< char32_t >
std::basic_ostream< charT, traits > & `std::basic_ostream< charT, traits > &` `const `basic_cstring_ref`< charT, traits > &`
std::size_t `basic_string_view< charT, traits >`
The default launcher for processes.

This launcher will be used by process if a process is launched through the constructor:

    process proc("test", {});
    // equivalent to
    process prod = default_launcher()("test", {});

implementation_defined
Initializer for the environment of sub process.

This will set the environment in a subprocess:

    process proc{executor, find_executable("printenv"), {"foo"}, process_environment{"foo=bar"}};

The environment initializer will persist it's state, so that it can be used multiple times. Do however note the the Operating System is allowed to modify the internal state.

    auto exe = find_executable("printenv");
    process_environment env = {"FOO=BAR", "BAR=FOO"};

    process proc1(executor, exe, {"FOO"}, env);
    process proc2(executor, exe, {"BAR"}, env);

std::vector< `environment::key_value_pair` >
std::vector< const char * >
std::vector< const char * > `Args &&` `typename std::enable_if< std::is_convertible< decltype(*std::begin(std::declval< Args >())), `cstring_ref` >::value` `::type *nullptr`
std::vector< const char * > `Args &&` `typename std::enable_if< !std::is_convertible< decltype(*std::begin(std::declval< Args >())), `cstring_ref` >::value` `::type *nullptr`
error_code `posix::default_launcher &` `const filesystem::path &` `const char *const *`
std::initializer_list< string_view >
Args &&
A view object for the current environment of this process.

The view might (windows) or might not (posix) be owning; if it owns it will deallocate the on destruction, like a unique_ptr.

Note that accessing the environment in this way is not thread-safe.

    void dump_my_env(current_view env = current())
    {
       for (auto  & [k, v] : env)
           std::cout << k.string() << " = "  << v.string() << std::endl;
    }

`key_value_pair_view`
int
`key_value_pair_view`
`key_value_pair_view`
std::forward_iterator_tag
`iterator` &
`iterator` `int`
`key_value_pair_view`
const `iterator` &
const native_iterator &
environment::native_handle_type
`key_value_pair_view`
native_handle_type
`iterator`
`iterator`
current_view
&&
A class representing a key within an environment.
char_type
key_char_traits< char_type >
std::basic_string< char_type, traits_type >
basic_string_view< char_type, traits_type >
`key` & `string_type &&`
`key` & `const Source &`
`key` & `InputIt` `InputIt`
void
void ``key` &`
const value_type *
const string_type &
string_view_type
string_type
string_view_type
int `const `key` &`
int `const string_type &`
int `string_view_type`
int `const value_type *`
std::basic_string< CharT, Traits, Alloc > std::char_traits<CharT> std::allocator<CharT> `const Alloc &Alloc()`
std::string
std::wstring
const string_type &
bool
const value_type *
std::size_t
const `key` &
key
&&
const string_type &
string_type &&
const value_type *
value_type *
key_view
const Source &
decltype(std::declval< Source >().data())
nullptr
decltype(std::declval< Source >().size())
0u
const typename conditional< is_same< value_type, char >::value, wchar_t, char >::type *
InputIt
InputIt
`key` & `const `key` &`
`key` & ``key` &&`
`key` & `string_type &&`
`key` & `const Source &`
char_type
std::char_traits< char_type >
std::basic_string< char_type >
`basic_cstring_ref`< char_type >
`key_value_pair` & `string_type &&`
`key_value_pair` & `const Source &`
`key_value_pair` & `InputIt` `InputIt`
void
void ``key_value_pair` &`
const value_type *
const string_type &
`string_view_type`
string_type
string_view_type
typename string_view_type::string_view_type
key_value_pair_view
int `const `key_value_pair` &`
int `const string_type &`
int ``string_view_type``
int `const value_type *`
std::basic_string< CharT, Traits, Alloc > std::char_traits<CharT> std::allocator<CharT> `const Alloc &Alloc()`
std::string
std::wstring
const string_type &
bool
struct `key_view`
struct `value_view`
const value_type *
std::size_t
auto std::size_t
`key_view`
`value_view`
const `key_value_pair` &
key_value_pair
&&
key_view
value_view
key_view
std::initializer_list< basic_string_view< char_type > >
const string_type &
string_type &&
const value_type *
value_type *
key_value_pair_view
const Source &
decltype(std::declval< Source >().data())
nullptr
decltype(std::declval< Source >().size())
0u
const std::pair< Key, Value > &
const typename conditional< is_same< value_type, char >::value, wchar_t, char >::type *
InputIt
InputIt
`key_value_pair` & `const `key_value_pair` &`
`key_value_pair` & ``key_value_pair` &&`
`key_value_pair` & `string_type &&`
`key_value_pair` & `const Source &`
A view for a key value pair in an environment.
char_type
std::basic_string< char_type >
`basic_cstring_ref`< char_type >
std::char_traits< char_type >
void ``key_value_pair_view` &`
`string_view_type`
string_view_type
typename string_view_type::string_view_type
int ``key_value_pair_view``
int `const string_type &`
int ``string_view_type``
int `const value_type *`
std::basic_string< CharT, Traits, Alloc > std::char_traits<CharT> std::allocator<CharT> `const Alloc &Alloc()`
std::string
std::wstring
string_type
bool
`key_view`
`value_view`
auto std::size_t
const value_type *
const value_type *
std::size_t
`key_view`
`value_view`
const `key_value_pair_view` &
key_value_pair_view
&&
typename std::enable_if<is_constructible<`string_view_type`, Source>::value>::type
const Source &
const char_type *
char_type *
`key_value_pair_view` & `const `key_value_pair_view` &`
`key_value_pair_view` & ``key_value_pair_view` &&`
A view type for a key of an environment.
char_type
key_char_traits< char_type >
basic_string_view< char_type, traits_type >
std::basic_string< char_type, key_char_traits< char_type > >
void ``key_view` &`
string_view_type
string_view_type
int `const `key_view` &`
int `string_view_type`
int `const value_type *`
std::basic_string< CharT, Traits, Alloc > std::char_traits<CharT> std::allocator<CharT> `const Alloc &Alloc()`
std::string
std::wstring
string_type
bool
const value_type *
std::size_t
const `key_view` &
key_view
&&
typename std::enable_if<is_constructible<string_view_type, Source>::value>::type
const Source &
const char_type *
char_type *
`key_view` & `const `key_view` &`
`key_view` & ``key_view` &&`
`key_view` & `string_view_type`
char_type
value_char_traits< char_type >
std::basic_string< char_type, traits_type >
`basic_cstring_ref`< char_type, traits_type >
`value` & `string_type &&`
`value` & `const Source &`
`value` & `InputIt` `InputIt`
void `const `value` &`
void
void ``value` &`
const value_type *
const string_type &
`string_view_type`
string_type
string_view_type
typename string_view_type::string_view_type
int `const `value` &`
int `const string_type &`
int ``string_view_type``
int `const value_type *`
std::basic_string< CharT, Traits, Alloc > std::char_traits<CharT> std::allocator<CharT> `const Alloc &Alloc()`
std::string
std::wstring
const string_type &
bool
`value_iterator`
`value_iterator`
const value_type *
std::size_t
const `value` &
const string_type &
string_type &&
const value_type *
value_type *
value_view
const Source &
decltype(std::declval< Source >().data())
nullptr
decltype(std::declval< Source >().size())
0u
const typename conditional< is_same< value_type, char >::value, wchar_t, char >::type *
InputIt
InputIt
`value` & `const `value` &`
`value` & ``value` &&`
`value` & `string_type &&`
`value` & `const Source &`
The iterator used by a value or `value_view` to iterator through environments that are lists.
basic_string_view< char_type, value_char_traits< char_type > >
int
string_view_type
std::forward_iterator_tag
`value_iterator` &
`value_iterator` `int`
string_view_type
const `value_iterator` &
string_view_type
std::size_t
0u
A view for a value in an environment.
char_type
`basic_cstring_ref`< char_type, value_char_traits< char_type > >
std::basic_string< char_type, value_char_traits< char_type > >
value_char_traits< char_type >
void ``value_view` &`
`string_view_type`
string_view_type
typename string_view_type::string_view_type
int `const `value_view` &`
int ``string_view_type``
int `const value_type *`
std::basic_string< CharT, Traits, Alloc > std::char_traits<CharT> std::allocator<CharT> `const Alloc &Alloc()`
std::string
std::wstring
string_type
bool
`value_iterator`
`value_iterator`
const char_type *
const value_type *
std::size_t
const `value_view` &
value_view
&&
typename std::enable_if<is_constructible<`string_view_type`, Source>::value>::type
const Source &
const char_type *
char_type *
`value_view` & `const `value_view` &`
`value_view` & ``value_view` &&`
`value_view` & ``string_view_type``
A char traits type that reflects the OS rules for string representing environment keys.

Can be an alias of std::char_traits. May only be defined for `char` and `wchar_t`.

Windows treats keys as case-insensitive yet perserving. The char traits are made to reflect that behaviour.

implementation_defined
A char traits type that reflects the OS rules for string representing environment values.

Can be an alias of std::char_traits. May only be defined for `char` and `wchar_t`.

implementation_defined
The character type used by the environment. Either `char` or `wchar_t`.
implementation_defined
The native handle of an environment. Note that this can be an owning pointer and is generally not thread safe.
implementation_defined
constexpr char_type The equal character in an environment string used to separate key and value.
constexpr char_type The delimiter in environemtn lists. Commonly used by the `PATH` variable.
std::size_t `const `key_view` &`
std::size_t `const `boost::process::v2::environment::value_view` &`
std::size_t `const `boost::process::v2::environment::key_value_pair_view` &`
bool `const `value_view` &` `const`
bool `const `value_view` &` `const`
bool `const `value_view` &` `const`
bool `const `value_view` &` `const`
bool `const `value_view` &` `const`
bool `const `value_view` &` `const`
bool `const `key_value_pair_view` &` `const`
bool `const `key_value_pair_view` &` `const`
bool `const `key_value_pair_view` &` `const`
bool `const `key_value_pair_view` &` `const`
bool `const `key_value_pair_view` &` `const`
bool `const `key_value_pair_view` &` `const`
`current_view` Obtain a handle to the current environment.
filesystem::path current_view `Environment &&current()

The environment to search. Defaults to the current environment of this process

` Find the home folder in an environment-like type.

The environment type passed in must be a range with value T that fulfills the following requirements:

For `T value`

- std::get<0>(value) must return a type comparable to ``key_view``.

- std::get<1>(value) must return a type convertible to filesystem::path.

A filesystem::path to the home directory or an empty path if it cannot be found.

boost::process::v2::filesystem::path current_view `boost::process::v2::filesystem::path` `Environment &&current()

The environment to search. Defaults to the current environment of this process

` Find the executable `name` in an environment-like type.

The environment type passed in must be a range with value T that fulfills the following requirements:

For `T value`

- std::get<0>(value) must return a type comparable to ``key_view``.

- std::get<1>(value) must return a type convertible to ``value_view``.

A filesystem::path to the executable or an empty path if it cannot be found.

`value` `const `key` &` `error_code &` Get an environment variable from the current process.
`value` `const `key` &`
`value` ``basic_cstring_ref`< char_type, key_char_traits< char_type > >` `error_code &`
`value` ``basic_cstring_ref`< char_type, key_char_traits< char_type > >`
`value` `const char_type *` `error_code &`
`value` `const char_type *`
void `const `key` &` ``value_view`` `error_code &` Set an environment variable for the current process.

Disambiguating.

Throwing.

void `const `key` &` ``value_view``
void ``basic_cstring_ref`< char_type, key_char_traits< char_type > >` ``value_view`` `error_code &`
void ``basic_cstring_ref`< char_type, key_char_traits< char_type > >` ``value_view``
void `const char_type *` ``value_view`` `error_code &`
void `const char_type *` ``value_view``
void typename std::enable_if<!std::is_same<Char, char_type>::value>::type `const `key` &` `const Char *` `error_code &`
void typename std::enable_if<!std::is_same<Char, char_type>::value>::type `const `key` &` `const Char *`
void typename std::enable_if<!std::is_same<Char, char_type>::value>::type ``basic_cstring_ref`< char_type, key_char_traits< char_type > >` `const Char *` `error_code &`
void typename std::enable_if<!std::is_same<Char, char_type>::value>::type ``basic_cstring_ref`< char_type, key_char_traits< char_type > >` `const Char *`
void typename std::enable_if<!std::is_same<Char, char_type>::value>::type `const char_type *` `const Char *` `error_code &`
void typename std::enable_if<!std::is_same<Char, char_type>::value>::type `const char_type *` `const Char *`
void `const `key` &` `error_code &` Remove an environment variable from the current process.

Disambiguating.

Throwing.

void `const `key` &`
void ``basic_cstring_ref`< char_type, key_char_traits< char_type > >` `error_code &`
void ``basic_cstring_ref`< char_type, key_char_traits< char_type > >`
void `const char_type *` `error_code &`
void `const char_type *`
boost::process::v2::environment::key
std::size_t ``boost::process::v2::environment::key_view``
boost::process::v2::environment::key_value_pair
std::size_t ``boost::process::v2::environment::key_value_pair_view``
boost::process::v2::environment::key_value_pair_view
std::size_t ``boost::process::v2::environment::key_value_pair_view``
boost::process::v2::environment::key_view
std::size_t ``boost::process::v2::environment::key_view``
boost::process::v2::environment::value
std::size_t ``boost::process::v2::environment::value_view``
boost::process::v2::environment::value_view
std::size_t ``boost::process::v2::environment::value_view``
0u
boost::process::v2::environment::key_value_pair
`boost::process::v2::environment::key_view`
0u
boost::process::v2::environment::key_value_pair_view
`boost::process::v2::environment::key_view`
1u
boost::process::v2::environment::key_value_pair
`boost::process::v2::environment::value_view`
1u
boost::process::v2::environment::key_value_pair_view
`boost::process::v2::environment::value_view`
boost::process::v2::environment::key_value_pair
integral_constant< std::size_t, 2u >
boost::process::v2::environment::key_value_pair_view
integral_constant< std::size_t, 2u >
auto std::size_t `const `boost::process::v2::environment::key_value_pair` &`
auto std::size_t ``boost::process::v2::environment::key_value_pair_view``
= 1
Errors used for utf8 <-> UCS-2 conversions.
const error_category &
const error_category & An error category that can be used to interpret exit codes of subprocesses.

Currently not used by boost.process, but it might be in the future.

void run_my_process(filesystem::path pt, error_code & ec) { process proc(pt, {}); proc.wait(); ec.assign(proc.native_exit_code(), error::get_exit_code_category()); }

const error_category &
const error_category &
int

The asio executor of the process handle

basic_process
< Executor >

The process to be run.

Run a process and wait for it to complete.

int The exit code of the process

`system_error` An error that might have occurred during the wait.

int ``basic_process`< Executor >` `error_code &`
deduced boost::asio::any_io_executor Token WaitHandler ``basic_process`< Executor >` `WaitHandler &&handler` Execute a process asynchronously.

This function asynchronously for a process to complete.

Cancelling the execution will signal the child process to exit with the following interpretations:

- cancellation_type::total -> interrupt

- cancellation_type::partial -> request_exit

- cancellation_type::terminal -> terminate

It is to note that `async_execute` will us the lowest selected cancellation type. A subprocess might ignore anything not terminal.

error_code `error_code &` `native_exit_code_type` `const error_category &error::get_exit_code_category()`

Helper to subsume an exit-code into an error_code if there's no actual error isn't set.

    process proc{ctx, "exit", {"1"}};

    proc.async_wait(
        asio::deferred(
         [&proc](error_code ec, int)
         {
           return asio::deferred.values(
                     check_exit_code(ec, proc.native_exit_code())
                 );

       [](error_code ec)
       {
         assert(ec.value() == 10);
         assert(ec.category() == error::get_exit_code_category());
       }));

The native exit-code type, usually an integral value.

The OS may have a value different from `int` to represent the exit codes of subprocesses. It might also contain additional information.

implementation_defined
bool `native_exit_code_type` Check if the native exit code indicates the process is still running.
int `native_exit_code_type` Obtain the portable part of the exit code, i.e. what the subprocess has returned from main.
implementation_defined
pid_type Get the process id of the current process.
std::vector< pid_type > `boost::system::error_code &` List all available pids.
std::vector< pid_type > List all available pids.
pid_type `pid_type` `boost::system::error_code &`
pid_type `pid_type`
std::vector< pid_type > `pid_type` `boost::system::error_code &`
std::vector< pid_type > `pid_type`
boost::asio::any_io_executor
boost::process::v2::basic_process< boost::asio::any_io_executor >
A subprocess with automatically assigned pipes.

The purpose os the popen is to provide a convenient way to use the stdin & stdout of a process.

    popen proc(executor, find_executable("addr2line"), {argv[0]});
    asio::write(proc, asio::buffer("main\n"));
    std::string line;
    asio::read_until(proc, asio::dynamic_buffer(line), '\n');

Popen can be used as a stream object in other protocols.

Rebinds the popen type to another executor.
The pipe type when rebound to the specified executor.
`basic_popen`< Executor1 >
The executor of the process.
Executor
The type used for stdin on the parent process side.
boost::asio::basic_writable_pipe< Executor >
The type used for stdout on the parent process side.
boost::asio::basic_readable_pipe< Executor >
stdin_type & Get the stdin pipe.
stdout_type & Get the stdout pipe.
const stdin_type & Get the stdin pipe.
const stdout_type & Get the stdout pipe.
std::size_t `const ConstBufferSequence &

One or more data buffers to be written to the pipe.

` Write some data to the pipe.

This function is used to write data to the pipe. The function call will block until one or more bytes of the data has been written successfully, or until an error occurs.

The write_some operation may not transmit all of the data to the peer. Consider using the write function if you need to ensure that all data is written before the blocking operation completes.

# Example

To write a single data buffer use the buffer function as follows:

    pipe.write_some(boost::asio::buffer(data, size));

See the buffer documentation for information on writing multiple buffers in one go, and how to use it with arrays, boost::array or std::vector.

The number of bytes written.

`boost::system::system_error` Thrown on failure. An error code of boost::asio::error::eof indicates that the connection was closed by the subprocess.

std::size_t `const ConstBufferSequence &

One or more data buffers to be written to the pipe.

` `boost::system::error_code &

Set to indicate what error occurred, if any.

` Write some data to the pipe.

This function is used to write data to the pipe. The function call will block until one or more bytes of the data has been written successfully, or until an error occurs.

The write_some operation may not transmit all of the data to the subprocess. Consider using the write function if you need to ensure that all data is written before the blocking operation completes.

The number of bytes written. Returns 0 if an error occurred.

deduced BOOST_ASIO_COMPLETION_TOKEN_FOR(void(boost::system::error_code, std::size_t)) WriteToken BOOST_ASIO_DEFAULT_COMPLETION_TOKEN_TYPE(executor_type) `const ConstBufferSequence &

One or more data buffers to be written to the pipe. Although the buffers object may be copied as necessary, ownership of the underlying memory blocks is retained by the caller, which must guarantee that they remain valid until the completion handler is called.

` `BOOST_ASIO_MOVE_ARG(WriteToken) token DEFAULT(executor_type)` Start an asynchronous write.

This function is used to asynchronously write data to the pipe. It is an initiating function for an asynchronous_operation, and always returns immediately.

# Completion Signature

    void(boost::system::error_code, std::size_t)

The write operation may not transmit all of the data to the peer. Consider using the async_write function if you need to ensure that all data is written before the asynchronous operation completes.

# Example

To write a single data buffer use the buffer function as follows:

    popen.async_write_some(boost::asio::buffer(data, size), handler);

See the buffer documentation for information on writing multiple buffers in one go, and how to use it with arrays, boost::array or std::vector.
std::size_t `const MutableBufferSequence &

One or more buffers into which the data will be read.

` Read some data from the pipe.

This function is used to read data from the pipe. The function call will block until one or more bytes of data has been read successfully, or until an error occurs.

The read_some operation may not read all of the requested number of bytes. Consider using the read function if you need to ensure that the requested amount of data is read before the blocking operation completes.

# Example

To read into a single data buffer use the buffer function as follows:

    basic_readable_pipe.read_some(boost::asio::buffer(data, size));

See the buffer documentation for information on reading into multiple buffers in one go, and how to use it with arrays, boost::array or std::vector.

The number of bytes read.

`boost::system::system_error` Thrown on failure. An error code of boost::asio::error::eof indicates that the connection was closed by the peer.

std::size_t `const MutableBufferSequence &

One or more buffers into which the data will be read.

` `boost::system::error_code &

Set to indicate what error occurred, if any.

` Read some data from the pipe.

This function is used to read data from the pipe. The function call will block until one or more bytes of data has been read successfully, or until an error occurs.

The read_some operation may not read all of the requested number of bytes. Consider using the read function if you need to ensure that the requested amount of data is read before the blocking operation completes.

The number of bytes read. Returns 0 if an error occurred.

deduced BOOST_ASIO_COMPLETION_TOKEN_FOR(void(boost::system::error_code, std::size_t)) ReadToken BOOST_ASIO_DEFAULT_COMPLETION_TOKEN_TYPE(executor_type) `const MutableBufferSequence &

One or more buffers into which the data will be read. Although the buffers object may be copied as necessary, ownership of the underlying memory blocks is retained by the caller, which must guarantee that they remain valid until the completion handler is called.

` `BOOST_ASIO_MOVE_ARG(ReadToken) token DEFAULT(executor_type)` Start an asynchronous read.

This function is used to asynchronously read data from the pipe. It is an initiating function for an asynchronous_operation, and always returns immediately.

# Completion Signature

    void(boost::system::error_code, std::size_t)

The read operation may not read all of the requested number of bytes. Consider using the async_read function if you need to ensure that the requested amount of data is read before the asynchronous operation completes.

# Example

To read into a single data buffer use the buffer function as follows:

    basic_readable_pipe.async_read_some(
        boost::asio::buffer(data, size), handler);

See the buffer documentation for information on reading into multiple buffers in one go, and how to use it with arrays, boost::array or std::vector.
basic_popen
&&
Move construct a popen.
`basic_popen` & ``basic_popen` &&` Move assign a popen.
basic_popen
< Executor1 > &&
Move construct a popen and change the executor type.
executor_type
Create a closed process handle.
ExecutionContext &
typename std::enable_if< is_convertible< ExecutionContext &, boost::asio::execution_context & >::value, void * >::type
nullptr
Create a closed process handle.
typename ...
executor_type
const filesystem::path &
std::initializer_list< string_view >
Inits &&...
Construct a child from a property list and launch it using the default process launcher.
typename ...
Launcher &&
executor_type
const filesystem::path &
std::initializer_list< string_view >
Inits &&...
Construct a child from a property list and launch it using the default process launcher.
typename ...
executor_type
const filesystem::path &
Args &&
Inits &&...
Construct a child from a property list and launch it using the default process launcher.
typename ...
Launcher &&
executor_type
const filesystem::path &
Args &&
Inits &&...
Construct a child from a property list and launch it using the default process launcher.
typename ...
ExecutionContext &
typename std::enable_if< std::is_convertible< ExecutionContext &, boost::asio::execution_context & >::value, const filesystem::path & >::type
std::initializer_list< string_view >
Inits &&...
Construct a child from a property list and launch it using the default process launcher.
typename ...
Launcher &&
ExecutionContext &
typename std::enable_if< std::is_convertible< ExecutionContext &, boost::asio::execution_context & >::value, const filesystem::path & >::type
std::initializer_list< string_view >
Inits &&...
Construct a child from a property list and launch it using the default process launcher.
typename ...
ExecutionContext &
typename std::enable_if< std::is_convertible< ExecutionContext &, boost::asio::execution_context & >::value, const filesystem::path & >::type
Args &&
Inits &&...
Construct a child from a property list and launch it using the default process launcher.
typename ...
Launcher &&
ExecutionContext &
typename std::enable_if< std::is_convertible< ExecutionContext &, boost::asio::execution_context & >::value, const filesystem::path & >::type
Args &&
Inits &&...
Construct a child from a property list and launch it using the default process launcher.
A popen object with the default executor.
`basic_popen`<>
boost::asio::any_io_executor
A class managing a subprocess.
`basic_process_handle`< Executor > &
native_exit_code_type &
void `Self &&`
void `Self &&` `error_code` `native_exit_code_type`
Rebinds the process_handle to another executor.
The socket type when rebound to the specified executor.
`basic_process`< Executor1 >
The executor of the process.
Executor
The non-closing handle type.
`basic_process_handle`< executor_type >
Provides access to underlying operating system facilities.
typename handle_type::native_handle_type
executor_type Get the executor of the process.
handle_type & Get the underlying non-closing handle.
const handle_type & Get the underlying non-closing handle.
void Sends the process a signal to ask for an interrupt, which the process may interpret as a shutdown.

Maybe be ignored by the subprocess.

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

void `error_code &`
void
void `error_code &` Sends the process a signal to ask for a graceful shutdown. Maybe be ignored by the subprocess.

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

void `error_code &` Send the process a signal requesting it to stop. This may rely on undocumented functions.
void Send the process a signal requesting it to stop. This may rely on undocumented functions.
void `error_code &` Send the process a signal requesting it to resume. This may rely on undocumented functions.
void Send the process a signal requesting it to resume. This may rely on undocumented functions.
void
void `error_code &` Unconditionally terminates the process and stores the exit code in exit_status.
int
int `error_code &` Waits for the process to exit, store the exit code internally and return it.

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

handle_type Detach the process.
native_handle_type Get the native.
int Return the evaluated exit_code.
pid_type Get the id of the process;.
native_exit_code_type The native handle of the process.

This might be undefined on posix systems that only support signals

bool Checks if the current process is running.

If it has already completed the exit code will be stored internally and can be obtained by calling `exit_code.

bool `error_code &`

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

bool Check if the process is referring to an existing process.

Note that this might be a process that already exited.

deduced Token WaitHandler `WaitHandler &&handler` Asynchronously wait for the process to exit and deliver the native exit-code in the completion handler.

An empty process is similar to a default constructed thread. It holds an empty handle and is a place holder for a process that is to be launched later.

const `basic_process` &
`basic_process` & `const `basic_process` &`
basic_process
&&
Move construct the process. It will be detached from `lhs`.
`basic_process` & ``basic_process` &&` Move assign a process. It will be detached from `lhs`.
basic_process
< Executor1 > &&
Move construct and rebind the executor.
typename ...
executor_type
const filesystem::path &
std::initializer_list< string_view >
Inits &&...
Construct a child from a property list and launch it using the default launcher..
typename ...
executor_type
const filesystem::path &
Args &&
Inits &&...
Construct a child from a property list and launch it using the default launcher..
typename ...
ExecutionContext &
typename std::enable_if< std::is_convertible< ExecutionContext &, boost::asio::execution_context & >::value, const filesystem::path & >::type
std::initializer_list< string_view >
Inits &&...
Construct a child from a property list and launch it using the default launcher..
typename ...
ExecutionContext &
typename std::enable_if< std::is_convertible< ExecutionContext &, boost::asio::execution_context & >::value, const filesystem::path & >::type
Args &&
Inits &&...
Construct a child from a property list and launch it using the default launcher.
executor_type
pid_type
Attach to an existing process.
executor_type
pid_type
native_handle_type
Attach to an existing process and the internal handle.
executor_type
Create an invalid handle.
ExecutionContext &
pid_type
typename std::enable_if< std::is_convertible< ExecutionContext &, boost::asio::execution_context & >::value, void * >::type
nullptr
Attach to an existing process.
ExecutionContext &
pid_type
native_handle_type
typename std::enable_if< std::is_convertible< ExecutionContext &, boost::asio::execution_context & >::value, void * >::type
nullptr
Attach to an existing process and the internal handle.
ExecutionContext &
typename std::enable_if< is_convertible< ExecutionContext &, boost::asio::execution_context & >::value, void * >::type
nullptr
Create an invalid handle.
Destruct the handle and terminate the process if it wasn't detached.
Process with the default executor.
`basic_process`
boost::asio::any_io_executor

A process handle is an unmanaged version of a process. This means it does not terminate the proces on destruction and will not keep track of the exit-code.

Note that the exit code might be discovered early, during a call to `running`. Thus it can only be discovered that process has exited already.

Rebinds the process_handle to another executor.
The socket type when rebound to the specified executor.
`basic_process_handle`< Executor1 >
The native handle of the process.

This might be undefined on posix systems that only support signals

implementation_defined
The executor_type of the process_handle.
Executor
void error_code &
executor_type Getter for the executor.
pid_type Get the id of the process.
void `error_code &` Terminate the process if it's still running and ignore the result.
void

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

void `native_exit_code_type &` `error_code &` wait for the process to exit and store the exit code in exit_status.

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

void `native_exit_code_type &`
void `error_code &` Sends the process a signal to ask for an interrupt, which the process may interpret as a shutdown.

Maybe be ignored by the subprocess.

void

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

void `error_code &` Sends the process a signal to ask for a graceful shutdown. Maybe be ignored by the subprocess.

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

void Unconditionally terminates the process and stores the exit code in exit_status.
void `native_exit_code_type &`

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

bool `native_exit_code_type &` `error_code &` Checks if the current process is running.

If it has already completed, it assigns the exit code to `exit_code`.

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

bool `native_exit_code_type &`
bool Check if the process handle is referring to an existing process.
deduced Token WaitHandler `WaitHandler &&handler` Asynchronously wait for the process to exit and deliver the native exit-code in the completion handler.

The context must fulfill the asio::execution_context requirements

ExecutionContext &
Construct a `basic_process_handle` from an execution_context.

executor_type
Construct an empty process_handle from an executor.
executor_type
pid_type
Construct an empty process_handle from an executor and bind it to a pid.

On NON-linux posix systems this call is not able to obtain a file-descriptor and will thus rely on signals.

executor_type
pid_type
native_handle_type
Construct an empty process_handle from an executor and bind it to a pid and the native-handle.

On some non-linux posix systems this overload is not present.

basic_process_handle
< Executor1 > &&
Move construct and rebind the executor.
Utility to parse commands.

This utility class parses command lines into tokens and allows users to executed based on textual inputs.

In v1, this was possible directly when starting a process, but has been removed based on the security risks associated with this.

By making the shell parsing explicitly, it encourages a user to run a sanity check on the executable before launching it.

# Example

    asio::io_context ctx;

    auto cmd = shell("my-app --help");
    auto exe = cmd.exe();
    check_if_malicious(exe);

    process proc{ctx, exe, cmd.args()};

char
const char **
int
char_type **
char_type **
char_type **
bool
std::size_t
args_type Native representation of the arguments to be used - excluding the executable.
filesystem::path `environment::current_view` `Environment &&environment::current()`
basic_string_view< Char, Traits >
basic_cstring_ref
< char_type >
basic_string_view< typename std::conditional< std::is_same< char_type, char >::value, wchar_t, char >::type >
const `shell` &
`shell` & `const `shell` &`
shell
&&
`shell` & ``shell` &&`
void
const error_category &
const error_category & Error category used by the shell parser.
Initializer for the starting directory of a subprocess to be launched.
filesystem::path
error_code `posix::default_launcher &` `const filesystem::path &` `const char *const *`
filesystem::path
The initializer for the stdio of a subprocess.

The subprocess initializer has three members:

- in for stdin

- out for stdout

- err for stderr

If the initializer is present all three will be set for the subprocess. By default they will inherit the stdio handles from the parent process. This means that this will forward stdio to the subprocess:

    asio::io_context ctx;
    v2::process proc(ctx, "/bin/bash", {}, v2::process_stdio{});

No constructors are provided in order to support designated initializers in later version of C++.

-     asio::io_context ctx;
      v2::process proc17(ctx, "/bin/bash", {}, v2::process_stdio{.stderr=nullptr});
      v2::process proc17(ctx, "/bin/bash", {}, v2::process_stdio{ {}, {}, nullptr});
                                                             stdin ^  ^ stderr

Valid initializers for any stdio are:

- `std::nullptr_t` assigning a null-device

- `FILE*` any open file, including `stdin`, `stdout` and `stderr`

- a filesystem::path, which will open a readable or writable depending on the direction of the stream

- `native_handle` any native file handle (`HANDLE` on windows) or file descriptor (`int` on posix)

- any io-object with a .native_handle() function that is compatible with the above. E.g. a asio::ip::tcp::socket

- an asio::basic_writeable_pipe for stdin or asio::basic_readable_pipe for stderr/stdout.

unspecified
unspecified
unspecified
error_code `posix::default_launcher &` `const filesystem::path &` `const char *const *`