MCPcopy Create free account
hub / github.com/bitcoin/bitcoin / pipe_cloexec

Function pipe_cloexec

src/util/subprocess.h:365–378  ·  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

363 * Second element is the write descriptor of pipe.
364 */
365 static inline
366 std::pair<int, int> pipe_cloexec() noexcept(false)
367 {
368 int pipe_fds[2];
369 int res = pipe(pipe_fds);
370 if (res) {
371 throw OSError("pipe failure", errno);
372 }
373
374 set_clo_on_exec(pipe_fds[0]);
375 set_clo_on_exec(pipe_fds[1]);
376
377 return std::make_pair(pipe_fds[0], pipe_fds[1]);
378 }
379#endif
380
381

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