inherit_env.hpp
Go to the documentation of this file.
1 // Copyright (c) 2006, 2007 Julio M. Merino Vidal
2 // Copyright (c) 2008 Ilya Sokolov, Boris Schaeling
3 // Copyright (c) 2009 Boris Schaeling
4 // Copyright (c) 2010 Felipe Tanus, Boris Schaeling
5 // Copyright (c) 2011, 2012 Jeff Flinn, Boris Schaeling
6 //
7 // Distributed under the Boost Software License, Version 1.0. (See accompanying
8 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
9 
10 #pragma once
11 
13 // From <https://svn.boost.org/trac/boost/changeset/67768>
14 #if defined(__APPLE__) && defined(__DYNAMIC__)
15 extern "C" {
16  extern char*** _NSGetEnviron(void);
17 }
18 # define environ (*_NSGetEnviron())
19 #else
20 # include <unistd.h>
21 #endif
22 
24 {
25 
27  {
28  public:
29  template <class PosixExecutor>
30  void on_fork_setup(PosixExecutor& e) const
31  {
32  e.env = environ;
33  }
34  };
35 
36 }
boost::process::posix::initializers::inherit_env
Definition: inherit_env.hpp:26
initializer_base.hpp
boost::process::posix::initializers
Definition: bind_fd.hpp:15
boost::process::posix::initializers::initializer_base
Definition: initializer_base.hpp:15
boost::process::posix::initializers::inherit_env::on_fork_setup
void on_fork_setup(PosixExecutor &e) const
Definition: inherit_env.hpp:30
environ
char ** environ