MCPcopy Create free account
hub / github.com/apache/mesos / SETSID

Method SETSID

3rdparty/libprocess/src/subprocess.cpp:90–106  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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

Callers

nothing calls this directly

Calls 3

ChildHookClass · 0.85
NothingClass · 0.85
ErrorClass · 0.50

Tested by

no test coverage detected