Boost logo

Boost Users :

Subject: [Boost-users] Boost Process fails on Solaris 10 in async mode
From: Sanket Sharma (sanketsharma09_at_[hidden])
Date: 2018-12-18 05:19:18


Hi,

I tried installing boost process on my Solaris 10 Sparc machine. On
compiling it using gcc-6.3.0, I ran into a static assert failure at compile
time at
https://github.com/boostorg/process/blob/boost-1.68.0/include/boost/process/detail/posix/is_running.hpp#L20.
In order to fix that, I changed
static_assert(!WIFEXITED(still_active) && !WIFSIGNALED(still_active), "Internal
Error");
to static_assert(!WIFEXITED(still_active), "Internal Error");

There is some discussion about this at
https://www.openwall.com/lists/musl/2018/08/10/1

Now, the following code works well onCentOS 7(where no change was made to
Boost process), but fails on Solaris 10 (where I made the above change as a
workaround). On Solaris 10, the return code is 127 and stdout and stderr are
empty.

#include <iostream>#include <thread>#include
<boost/process.hpp>#include <boost/asio.hpp>
namespace bp = boost::process ;int main(int argc, char** argv){
    std::future<std::string> dataOut;
    std::future<std::string> dataErr;

    std::string command = "ls";
    boost::asio::io_service ios;
    bp::child c(command, bp::std_out > dataOut, bp::std_err > dataErr, ios);
    ios.run();
    c.wait();
    int result = c.exit_code();
    std::string stdOut = dataOut.get();
    std::string stdErr = dataErr.get();
    std::cout << "Exit Code " << result << std::endl;
    std::cout << "stdOut " << stdOut << std::endl;
    std::cout << "stdErr " << stdErr << std::endl;
    return 0;}

Output on CentOS 7

Exit Code 0
stdOut a.out
main.cppProcess.cppProcess.h
simple.cpp

stdErr

Output on Solaris 10

Exit Code 127
stdOut
stdErr

1. Has my workaround to install Boost process on Solaris 10 broken it?
2. Is Boost-1.68.0 not supported on Solaris?
3. Is there a way I can get Boost Process to work on Solaris 10 in async
mode?

https://stackoverflow.com/questions/53780273/boost-process-fails-on-solaris-10-in-async-mode

-- 
Regards,
Sanket


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net