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

Function supported

src/linux/ns.cpp:139–162  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

137
138
139Try<bool> supported(int nsTypes)
140{
141 int supported = 0;
142
143 foreach (const int n, nstypes()) {
144 if (nsTypes & n) {
145 supported |= n;
146 }
147 }
148
149 if ((nsTypes & CLONE_NEWUSER) && (supported & CLONE_NEWUSER)) {
150 Try<Version> version = mesos::kernelVersion();
151
152 if (version.isError()) {
153 return Error(version.error());
154 }
155
156 if (version.get() < Version(3, 12, 0)) {
157 return false;
158 }
159 }
160
161 return supported == nsTypes;
162}
163
164
165Try<Nothing> setns(

Callers

nothing calls this directly

Calls 6

kernelVersionFunction · 0.85
errorMethod · 0.65
ErrorFunction · 0.50
VersionEnum · 0.50
isErrorMethod · 0.45
getMethod · 0.45

Tested by

no test coverage detected