MCPcopy Create free account
hub / github.com/arun11299/cpp-subprocess / pipe_cloexec

Function pipe_cloexec

cpp-subprocess/subprocess.hpp:615–628  ·  view source on GitHub ↗

! * Function: pipe_cloexec * Creates a pipe and sets FD_CLOEXEC flag on both * read and write descriptors of the pipe. * Parameters: * [out] : A pair of file descriptors. * First element of pair is the read descriptor of pipe. * Second element is the write descriptor of pipe. */

Source from the content-addressed store, hash-verified

613 * Second element is the write descriptor of pipe.
614 */
615 static inline
616 std::pair<int, int> pipe_cloexec() noexcept(false)
617 {
618 int pipe_fds[2];
619 int res = pipe(pipe_fds);
620 if (res) {
621 throw OSError("pipe failure", errno);
622 }
623
624 set_clo_on_exec(pipe_fds[0]);
625 set_clo_on_exec(pipe_fds[1]);
626
627 return std::make_pair(pipe_fds[0], pipe_fds[1]);
628 }
629#endif
630
631

Callers 4

inputMethod · 0.85
outputMethod · 0.85
errorMethod · 0.85
execute_processMethod · 0.85

Calls 2

OSErrorClass · 0.85
set_clo_on_execFunction · 0.85

Tested by

no test coverage detected