MCPcopy Create free account
hub / github.com/3rdparty/libprocess / SETSID

Method SETSID

src/subprocess.cpp:89–105  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

87
88
89Subprocess::ChildHook Subprocess::ChildHook::SETSID()
90{
91 return Subprocess::ChildHook([]() -> Try<Nothing> {
92 // TODO(josephw): By default, child processes on Windows do not
93 // terminate when the parent terminates. We need to implement
94 // `JobObject` support to change this default.
95#ifndef __WINDOWS__
96 // Put child into its own process session to prevent the parent
97 // suicide on child process SIGKILL/SIGTERM.
98 if (::setsid() == -1) {
99 return Error("Could not setsid");
100 }
101#endif // __WINDOWS__
102
103 return Nothing();
104 });
105}
106
107
108#ifndef __WINDOWS__

Callers

nothing calls this directly

Calls 1

ChildHookClass · 0.85

Tested by

no test coverage detected