Boost C++ Libraries Home Libraries People FAQ More

PrevUpHomeNext

Struct context

boost::process::context

Synopsis

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


struct context {
  // types
  typedef std::map< stream_id, boost::function< stream_ends(stream_type)> > streams_t;

  // construct/copy/destruct
  context();
  streams_t streams;
  std::string process_name;
  std::string work_dir;
  environment env;
  boost::function< void()> setup;
};

Description

Context class to define how a child process is created.

The context class is used to configure streams, to set the work directory and define environment variables. It is also used to change a process name (the variable commonly known as argv[0]).

context public construct/copy/destruct

  1. context();

    Constructs a process context.

    The default behavior of standard streams is to inherit them. The current work directory is also the work directory of the child process. The child process also inherits all environment variables.


PrevUpHomeNext