TODO(jpeach): As we move namespace parameters from strings to CLONE constants, we should be able to eventually remove the internal uses of this function.
| 103 | // constants, we should be able to eventually remove the internal uses |
| 104 | // of this function. |
| 105 | static set<string> namespaces() |
| 106 | { |
| 107 | set<string> result; |
| 108 | |
| 109 | Try<std::list<string>> entries = os::ls("/proc/self/ns"); |
| 110 | if (entries.isSome()) { |
| 111 | foreach (const string& entry, entries.get()) { |
| 112 | // Introduced in Linux 4.12, pid_for_children is a handle for the PID |
| 113 | // namespace of child processes created by the current process. |
| 114 | if (entry != "pid_for_children") { |
| 115 | result.insert(entry); |
| 116 | } |
| 117 | } |
| 118 | } |
| 119 | |
| 120 | return result; |
| 121 | } |
| 122 | |
| 123 | |
| 124 | set<int> nstypes() |