MCPcopy Create free account
hub / github.com/apache/arrow / RunInChild

Method RunInChild

cpp/src/arrow/util/cancel_test.cc:208–221  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

206
207#ifndef _WIN32
208 void RunInChild(std::function<void()> func) {
209 auto child_pid = fork();
210 if (child_pid == -1) {
211 ASSERT_OK(internal::IOErrorFromErrno(errno, "Error calling fork(): "));
212 }
213 if (child_pid == 0) {
214 // Child
215 ASSERT_NO_FATAL_FAILURE(func()) << "Failure in child process";
216 std::exit(0);
217 } else {
218 // Parent
219 AssertChildExit(child_pid);
220 }
221 }
222#endif
223
224 protected:

Callers

nothing calls this directly

Calls 3

IOErrorFromErrnoFunction · 0.85
AssertChildExitFunction · 0.85
funcFunction · 0.50

Tested by

no test coverage detected