MCPcopy Create free account
hub / github.com/ROCm/rocm-systems / open

Method open

projects/rocdbgapi/src/utils_linux.cpp:85–106  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

83};
84
85bool
86pipe_t::open ()
87{
88 std::array<file_desc_t, 2> pipe;
89 if (::pipe2 (pipe.data (), O_CLOEXEC))
90 {
91 warning ("pipe_t::open: pipe2 failed: %s", strerror (errno));
92 return false;
93 }
94
95 m_pipe_fd.emplace (pipe);
96
97 if (::fcntl (read_fd (), F_SETFL, O_NONBLOCK)
98 || ::fcntl (write_fd (), F_SETFL, O_NONBLOCK))
99 {
100 warning ("pipe_t::open: fcntl failed: %s", strerror (errno));
101 close ();
102 return false;
103 }
104
105 return true;
106}
107
108void
109pipe_t::close ()

Callers 15

InitializeMethod · 0.45
__call__Method · 0.45
_print_json_outputMethod · 0.45
_print_csv_outputMethod · 0.45
_print_tabular_outputMethod · 0.45
cper_printMethod · 0.45
_write_cper_filesMethod · 0.45
wake_deviceFunction · 0.45

Calls 6

fcntlFunction · 0.85
read_fdFunction · 0.85
warningFunction · 0.70
closeFunction · 0.50
dataMethod · 0.45
emplaceMethod · 0.45

Tested by 1

InitializeMethod · 0.36