Boost logo

Boost :

Subject: Re: [boost] [gsoc] Boost.Process done
From: Ilya Sokolov (ilyasokol_at_[hidden])
Date: 2010-09-10 06:15:15


On Fri, 10 Sep 2010 03:33:53 +0400
Ilya Sokolov <ilyasokol_at_[hidden]> wrote:
> [snip]
>
> class redirect_to
> {
> fileno to_;
> public:
>
> redirect_to(fileno to): to_(to) {} std::pair<handle, handle>
> operator()(fileno fn, const child_streams& cs)
> {
> BOOST_ASSERT(fn > to_);
> #ifndef _WIN32
> handle child_end(posix_dup2(to_, fn));
> #else
> // ...
> #endif
> handle parent_end;
> return std::make_pair(child_end, parent_end);
> }
> };

Not sure who wrote that code ;-) I should stop posting at night.

class redirect_to
{
    fileno to_;
public:
    redirect_to(fileno to): to_(to) {}

    std::pair<handle, handle>
    operator()(fileno fn, const child_streams& cs)
    {
        BOOST_ASSERT(fn > to_);
        child_streams::const_iterator it =
            // find pair in cs where it->first == to_
#ifndef _WIN32
        handle child_end(posix_dup2(it->second, fn));
#else
        // ...
#endif
        handle parent_end;
        return std::make_pair(child_end, parent_end);
    }
};


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk