| 2401 | */ |
| 2402 | template <typename C, typename T> |
| 2403 | std::size_t |
| 2404 | basic_pstreambuf<C,T>::fopen(FILE*& in, FILE*& out, FILE*& err) |
| 2405 | { |
| 2406 | in = out = err = NULL; |
| 2407 | std::size_t open_files = 0; |
| 2408 | if (wpipe() > -1) |
| 2409 | { |
| 2410 | if ((in = ::fdopen(wpipe(), "w"))) |
| 2411 | { |
| 2412 | open_files |= pstdin; |
| 2413 | } |
| 2414 | } |
| 2415 | if (rpipe(rsrc_out) > -1) |
| 2416 | { |
| 2417 | if ((out = ::fdopen(rpipe(rsrc_out), "r"))) |
| 2418 | { |
| 2419 | open_files |= pstdout; |
| 2420 | } |
| 2421 | } |
| 2422 | if (rpipe(rsrc_err) > -1) |
| 2423 | { |
| 2424 | if ((err = ::fdopen(rpipe(rsrc_err), "r"))) |
| 2425 | { |
| 2426 | open_files |= pstderr; |
| 2427 | } |
| 2428 | } |
| 2429 | return open_files; |
| 2430 | } |
| 2431 | |
| 2432 | /** |
| 2433 | * @warning This function exposes the internals of the stream buffer and |
nothing calls this directly
no outgoing calls
no test coverage detected