Am Samstag, 16. September 2006 11:29 schrieb Angus Leeming: > Lars Gullik Bjønnes wrote: > > | We use RPC for windows at work. Some fairly outdated version from Sun > > | IIRC but it works. > > > > General RPC? Or a system that both server and client needs to link > > with the same RPC lib? > > Didn't Georg post a link to a Summer of Code project that implemented > Boost.Process? Has it got as far as the Boost review process yet?
No, and IIRC ther are some minor problems to be sorted out first. But your post finally made me use it in one of my own projects (which I had planned since I saw it the first time), and it works well. The only glitch I saw is this: If you try to get the exit status of the child with child::wait() it will throw an exception if the child is already dead. The big advantage over our code is that we can redirect stderr. That enables us to capture error messages from the myriad of external tools we use. The svn address is https://www.boost-consulting.com:8443/svn/main/boost/soc/2006/process/trunk, and I need the attached patch to compile it. Georg
Index: boost/process/detail/posix_ops.hpp =================================================================== --- boost/process/detail/posix_ops.hpp (Revision 1309) +++ boost/process/detail/posix_ops.hpp (Arbeitskopie) @@ -37,6 +37,7 @@ extern "C" { #include <map> #include <set> #include <utility> +#include <vector> #include <boost/optional.hpp> #include <boost/process/detail/environment.hpp> @@ -263,7 +264,7 @@ posix_setup::operator()(void) //! inline void -setup_input(info_map& info, bool closeflags[], int maxdescs) +setup_input(info_map& info, std::vector<bool> & closeflags, int maxdescs) { for (info_map::iterator iter = info.begin(); iter != info.end(); iter++) { int d = (*iter).first; @@ -313,7 +314,7 @@ setup_input(info_map& info, bool closefl //! inline void -setup_output(info_map& info, merge_set& merges, bool closeflags[], +setup_output(info_map& info, merge_set& merges, std::vector<bool> & closeflags, int maxdescs) { for (info_map::iterator iter = info.begin(); iter != info.end(); iter++) { @@ -402,9 +403,7 @@ posix_start(const Executable& exe, int maxdescs = 128; // XXX #endif try { - bool closeflags[maxdescs]; - for (int i = 0; i < maxdescs; i++) - closeflags[i] = true; + std::vector<bool> closeflags(maxdescs, true); setup_input(infoin, closeflags, maxdescs); setup_output(infoout, merges, closeflags, maxdescs); Index: boost/process/detail/environment.hpp =================================================================== --- boost/process/detail/environment.hpp (Revision 1309) +++ boost/process/detail/environment.hpp (Arbeitskopie) @@ -44,7 +44,7 @@ extern "C" { #if defined(BOOST_PROCESS_POSIX_API) extern "C" { extern char** environ; -}; +} #endif namespace boost {