mesos-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From git-site-r...@apache.org
Subject [5/7] mesos-site git commit: Updated the website built from mesos SHA: 8165188.
Date Wed, 01 Nov 2017 06:19:13 GMT
http://git-wip-us.apache.org/repos/asf/mesos-site/blob/84230802/content/api/latest/c++/ns_8hpp_source.html
----------------------------------------------------------------------
diff --git a/content/api/latest/c++/ns_8hpp_source.html b/content/api/latest/c++/ns_8hpp_source.html
index d2b0785..eb3fcb3 100644
--- a/content/api/latest/c++/ns_8hpp_source.html
+++ b/content/api/latest/c++/ns_8hpp_source.html
@@ -77,694 +77,131 @@
 <div class="line"><a name="l00023"></a><span class="lineno">   23</span>&#160;<span class="preprocessor"></span><span class="preprocessor">#endif</span></div>
 <div class="line"><a name="l00024"></a><span class="lineno">   24</span>&#160;<span class="preprocessor"></span></div>
 <div class="line"><a name="l00025"></a><span class="lineno">   25</span>&#160;<span class="preprocessor">#include &lt;sched.h&gt;</span></div>
-<div class="line"><a name="l00026"></a><span class="lineno">   26</span>&#160;<span class="preprocessor">#include &lt;unistd.h&gt;</span></div>
-<div class="line"><a name="l00027"></a><span class="lineno">   27</span>&#160;</div>
-<div class="line"><a name="l00028"></a><span class="lineno">   28</span>&#160;<span class="preprocessor">#include &lt;sys/syscall.h&gt;</span></div>
-<div class="line"><a name="l00029"></a><span class="lineno">   29</span>&#160;<span class="preprocessor">#include &lt;sys/wait.h&gt;</span></div>
-<div class="line"><a name="l00030"></a><span class="lineno">   30</span>&#160;</div>
-<div class="line"><a name="l00031"></a><span class="lineno">   31</span>&#160;<span class="preprocessor">#include &lt;set&gt;</span></div>
-<div class="line"><a name="l00032"></a><span class="lineno">   32</span>&#160;<span class="preprocessor">#include &lt;string&gt;</span></div>
-<div class="line"><a name="l00033"></a><span class="lineno">   33</span>&#160;<span class="preprocessor">#include &lt;vector&gt;</span></div>
-<div class="line"><a name="l00034"></a><span class="lineno">   34</span>&#160;</div>
-<div class="line"><a name="l00035"></a><span class="lineno">   35</span>&#160;<span class="preprocessor">#include &lt;<a class="code" href="assert_8hpp.html">stout/assert.hpp</a>&gt;</span></div>
-<div class="line"><a name="l00036"></a><span class="lineno">   36</span>&#160;<span class="preprocessor">#include &lt;<a class="code" href="error_8hpp.html">stout/error.hpp</a>&gt;</span></div>
-<div class="line"><a name="l00037"></a><span class="lineno">   37</span>&#160;<span class="preprocessor">#include &lt;<a class="code" href="hashmap_8hpp.html">stout/hashmap.hpp</a>&gt;</span></div>
-<div class="line"><a name="l00038"></a><span class="lineno">   38</span>&#160;<span class="preprocessor">#include &lt;<a class="code" href="nothing_8hpp.html">stout/nothing.hpp</a>&gt;</span></div>
-<div class="line"><a name="l00039"></a><span class="lineno">   39</span>&#160;<span class="preprocessor">#include &lt;<a class="code" href="os_8hpp.html">stout/os.hpp</a>&gt;</span></div>
-<div class="line"><a name="l00040"></a><span class="lineno">   40</span>&#160;<span class="preprocessor">#include &lt;<a class="code" href="path_8hpp.html">stout/path.hpp</a>&gt;</span></div>
-<div class="line"><a name="l00041"></a><span class="lineno">   41</span>&#160;<span class="preprocessor">#include &lt;<a class="code" href="proc_8hpp.html">stout/proc.hpp</a>&gt;</span></div>
-<div class="line"><a name="l00042"></a><span class="lineno">   42</span>&#160;<span class="preprocessor">#include &lt;<a class="code" href="result_8hpp.html">stout/result.hpp</a>&gt;</span></div>
-<div class="line"><a name="l00043"></a><span class="lineno">   43</span>&#160;<span class="preprocessor">#include &lt;<a class="code" href="stringify_8hpp.html">stout/stringify.hpp</a>&gt;</span></div>
-<div class="line"><a name="l00044"></a><span class="lineno">   44</span>&#160;<span class="preprocessor">#include &lt;<a class="code" href="strings_8hpp.html">stout/strings.hpp</a>&gt;</span></div>
-<div class="line"><a name="l00045"></a><span class="lineno">   45</span>&#160;<span class="preprocessor">#include &lt;<a class="code" href="try_8hpp.html">stout/try.hpp</a>&gt;</span></div>
-<div class="line"><a name="l00046"></a><span class="lineno">   46</span>&#160;</div>
-<div class="line"><a name="l00047"></a><span class="lineno">   47</span>&#160;<span class="preprocessor">#include &lt;<a class="code" href="exists_8hpp.html">stout/os/exists.hpp</a>&gt;</span></div>
-<div class="line"><a name="l00048"></a><span class="lineno">   48</span>&#160;<span class="preprocessor">#include &lt;<a class="code" href="ls_8hpp.html">stout/os/ls.hpp</a>&gt;</span></div>
-<div class="line"><a name="l00049"></a><span class="lineno">   49</span>&#160;</div>
-<div class="line"><a name="l00050"></a><span class="lineno">   50</span>&#160;<span class="preprocessor">#include &lt;<a class="code" href="collect_8hpp.html">process/collect.hpp</a>&gt;</span></div>
-<div class="line"><a name="l00051"></a><span class="lineno">   51</span>&#160;<span class="preprocessor">#include &lt;<a class="code" href="future_8hpp.html">process/future.hpp</a>&gt;</span></div>
-<div class="line"><a name="l00052"></a><span class="lineno">   52</span>&#160;<span class="preprocessor">#include &lt;<a class="code" href="reap_8hpp.html">process/reap.hpp</a>&gt;</span></div>
-<div class="line"><a name="l00053"></a><span class="lineno">   53</span>&#160;</div>
-<div class="line"><a name="l00054"></a><span class="lineno">   54</span>&#160;<span class="preprocessor">#include &quot;<a class="code" href="status__utils_8hpp.html">common/status_utils.hpp</a>&quot;</span></div>
-<div class="line"><a name="l00055"></a><span class="lineno">   55</span>&#160;</div>
-<div class="line"><a name="l00056"></a><span class="lineno">   56</span>&#160;<span class="preprocessor">#ifndef CLONE_NEWNS</span></div>
-<div class="line"><a name="l00057"></a><span class="lineno"><a class="line" href="ns_8hpp.html#aab02ccd05c3d9fa806d974e38a8debc4">   57</a></span>&#160;<span class="preprocessor"></span><span class="preprocessor">#define CLONE_NEWNS 0x00020000</span></div>
-<div class="line"><a name="l00058"></a><span class="lineno">   58</span>&#160;<span class="preprocessor"></span><span class="preprocessor">#endif</span></div>
-<div class="line"><a name="l00059"></a><span class="lineno">   59</span>&#160;<span class="preprocessor"></span></div>
-<div class="line"><a name="l00060"></a><span class="lineno">   60</span>&#160;<span class="preprocessor">#ifndef CLONE_NEWUTS</span></div>
-<div class="line"><a name="l00061"></a><span class="lineno"><a class="line" href="ns_8hpp.html#afaf1addd4b1e90196d1876896c1a53c3">   61</a></span>&#160;<span class="preprocessor"></span><span class="preprocessor">#define CLONE_NEWUTS 0x04000000</span></div>
-<div class="line"><a name="l00062"></a><span class="lineno">   62</span>&#160;<span class="preprocessor"></span><span class="preprocessor">#endif</span></div>
-<div class="line"><a name="l00063"></a><span class="lineno">   63</span>&#160;<span class="preprocessor"></span></div>
-<div class="line"><a name="l00064"></a><span class="lineno">   64</span>&#160;<span class="preprocessor">#ifndef CLONE_NEWIPC</span></div>
-<div class="line"><a name="l00065"></a><span class="lineno"><a class="line" href="ns_8hpp.html#a1f702bf1b80ed7a8cef30e363a87e3e3">   65</a></span>&#160;<span class="preprocessor"></span><span class="preprocessor">#define CLONE_NEWIPC 0x08000000</span></div>
-<div class="line"><a name="l00066"></a><span class="lineno">   66</span>&#160;<span class="preprocessor"></span><span class="preprocessor">#endif</span></div>
-<div class="line"><a name="l00067"></a><span class="lineno">   67</span>&#160;<span class="preprocessor"></span></div>
-<div class="line"><a name="l00068"></a><span class="lineno">   68</span>&#160;<span class="preprocessor">#ifndef CLONE_NEWPID</span></div>
-<div class="line"><a name="l00069"></a><span class="lineno"><a class="line" href="ns_8hpp.html#a2fa6801173606dd3492ca9061d1c4ad4">   69</a></span>&#160;<span class="preprocessor"></span><span class="preprocessor">#define CLONE_NEWPID 0x20000000</span></div>
-<div class="line"><a name="l00070"></a><span class="lineno">   70</span>&#160;<span class="preprocessor"></span><span class="preprocessor">#endif</span></div>
-<div class="line"><a name="l00071"></a><span class="lineno">   71</span>&#160;<span class="preprocessor"></span></div>
-<div class="line"><a name="l00072"></a><span class="lineno">   72</span>&#160;<span class="preprocessor">#ifndef CLONE_NEWNET</span></div>
-<div class="line"><a name="l00073"></a><span class="lineno"><a class="line" href="ns_8hpp.html#a2ba1673aa7423b46a7bcfa8f68cd2bce">   73</a></span>&#160;<span class="preprocessor"></span><span class="preprocessor">#define CLONE_NEWNET 0x40000000</span></div>
-<div class="line"><a name="l00074"></a><span class="lineno">   74</span>&#160;<span class="preprocessor"></span><span class="preprocessor">#endif</span></div>
-<div class="line"><a name="l00075"></a><span class="lineno">   75</span>&#160;<span class="preprocessor"></span></div>
-<div class="line"><a name="l00076"></a><span class="lineno">   76</span>&#160;<span class="preprocessor">#ifndef CLONE_NEWUSER</span></div>
-<div class="line"><a name="l00077"></a><span class="lineno"><a class="line" href="ns_8hpp.html#a5d697cae6f0156524a1bd7d77bcf8e87">   77</a></span>&#160;<span class="preprocessor"></span><span class="preprocessor">#define CLONE_NEWUSER 0x10000000</span></div>
+<div class="line"><a name="l00026"></a><span class="lineno">   26</span>&#160;</div>
+<div class="line"><a name="l00027"></a><span class="lineno">   27</span>&#160;<span class="preprocessor">#include &lt;sys/syscall.h&gt;</span></div>
+<div class="line"><a name="l00028"></a><span class="lineno">   28</span>&#160;</div>
+<div class="line"><a name="l00029"></a><span class="lineno">   29</span>&#160;<span class="preprocessor">#include &lt;set&gt;</span></div>
+<div class="line"><a name="l00030"></a><span class="lineno">   30</span>&#160;<span class="preprocessor">#include &lt;string&gt;</span></div>
+<div class="line"><a name="l00031"></a><span class="lineno">   31</span>&#160;</div>
+<div class="line"><a name="l00032"></a><span class="lineno">   32</span>&#160;<span class="preprocessor">#include &lt;<a class="code" href="lambda_8hpp.html">stout/lambda.hpp</a>&gt;</span></div>
+<div class="line"><a name="l00033"></a><span class="lineno">   33</span>&#160;<span class="preprocessor">#include &lt;<a class="code" href="nothing_8hpp.html">stout/nothing.hpp</a>&gt;</span></div>
+<div class="line"><a name="l00034"></a><span class="lineno">   34</span>&#160;<span class="preprocessor">#include &lt;<a class="code" href="result_8hpp.html">stout/result.hpp</a>&gt;</span></div>
+<div class="line"><a name="l00035"></a><span class="lineno">   35</span>&#160;<span class="preprocessor">#include &lt;<a class="code" href="try_8hpp.html">stout/try.hpp</a>&gt;</span></div>
+<div class="line"><a name="l00036"></a><span class="lineno">   36</span>&#160;</div>
+<div class="line"><a name="l00037"></a><span class="lineno">   37</span>&#160;<span class="preprocessor">#ifndef CLONE_NEWNS</span></div>
+<div class="line"><a name="l00038"></a><span class="lineno"><a class="line" href="ns_8hpp.html#aab02ccd05c3d9fa806d974e38a8debc4">   38</a></span>&#160;<span class="preprocessor"></span><span class="preprocessor">#define CLONE_NEWNS 0x00020000</span></div>
+<div class="line"><a name="l00039"></a><span class="lineno">   39</span>&#160;<span class="preprocessor"></span><span class="preprocessor">#endif</span></div>
+<div class="line"><a name="l00040"></a><span class="lineno">   40</span>&#160;<span class="preprocessor"></span></div>
+<div class="line"><a name="l00041"></a><span class="lineno">   41</span>&#160;<span class="preprocessor">#ifndef CLONE_NEWUTS</span></div>
+<div class="line"><a name="l00042"></a><span class="lineno"><a class="line" href="ns_8hpp.html#afaf1addd4b1e90196d1876896c1a53c3">   42</a></span>&#160;<span class="preprocessor"></span><span class="preprocessor">#define CLONE_NEWUTS 0x04000000</span></div>
+<div class="line"><a name="l00043"></a><span class="lineno">   43</span>&#160;<span class="preprocessor"></span><span class="preprocessor">#endif</span></div>
+<div class="line"><a name="l00044"></a><span class="lineno">   44</span>&#160;<span class="preprocessor"></span></div>
+<div class="line"><a name="l00045"></a><span class="lineno">   45</span>&#160;<span class="preprocessor">#ifndef CLONE_NEWIPC</span></div>
+<div class="line"><a name="l00046"></a><span class="lineno"><a class="line" href="ns_8hpp.html#a1f702bf1b80ed7a8cef30e363a87e3e3">   46</a></span>&#160;<span class="preprocessor"></span><span class="preprocessor">#define CLONE_NEWIPC 0x08000000</span></div>
+<div class="line"><a name="l00047"></a><span class="lineno">   47</span>&#160;<span class="preprocessor"></span><span class="preprocessor">#endif</span></div>
+<div class="line"><a name="l00048"></a><span class="lineno">   48</span>&#160;<span class="preprocessor"></span></div>
+<div class="line"><a name="l00049"></a><span class="lineno">   49</span>&#160;<span class="preprocessor">#ifndef CLONE_NEWPID</span></div>
+<div class="line"><a name="l00050"></a><span class="lineno"><a class="line" href="ns_8hpp.html#a2fa6801173606dd3492ca9061d1c4ad4">   50</a></span>&#160;<span class="preprocessor"></span><span class="preprocessor">#define CLONE_NEWPID 0x20000000</span></div>
+<div class="line"><a name="l00051"></a><span class="lineno">   51</span>&#160;<span class="preprocessor"></span><span class="preprocessor">#endif</span></div>
+<div class="line"><a name="l00052"></a><span class="lineno">   52</span>&#160;<span class="preprocessor"></span></div>
+<div class="line"><a name="l00053"></a><span class="lineno">   53</span>&#160;<span class="preprocessor">#ifndef CLONE_NEWNET</span></div>
+<div class="line"><a name="l00054"></a><span class="lineno"><a class="line" href="ns_8hpp.html#a2ba1673aa7423b46a7bcfa8f68cd2bce">   54</a></span>&#160;<span class="preprocessor"></span><span class="preprocessor">#define CLONE_NEWNET 0x40000000</span></div>
+<div class="line"><a name="l00055"></a><span class="lineno">   55</span>&#160;<span class="preprocessor"></span><span class="preprocessor">#endif</span></div>
+<div class="line"><a name="l00056"></a><span class="lineno">   56</span>&#160;<span class="preprocessor"></span></div>
+<div class="line"><a name="l00057"></a><span class="lineno">   57</span>&#160;<span class="preprocessor">#ifndef CLONE_NEWUSER</span></div>
+<div class="line"><a name="l00058"></a><span class="lineno"><a class="line" href="ns_8hpp.html#a5d697cae6f0156524a1bd7d77bcf8e87">   58</a></span>&#160;<span class="preprocessor"></span><span class="preprocessor">#define CLONE_NEWUSER 0x10000000</span></div>
+<div class="line"><a name="l00059"></a><span class="lineno">   59</span>&#160;<span class="preprocessor"></span><span class="preprocessor">#endif</span></div>
+<div class="line"><a name="l00060"></a><span class="lineno">   60</span>&#160;<span class="preprocessor"></span></div>
+<div class="line"><a name="l00061"></a><span class="lineno">   61</span>&#160;<span class="preprocessor">#ifndef CLONE_NEWCGROUP</span></div>
+<div class="line"><a name="l00062"></a><span class="lineno"><a class="line" href="ns_8hpp.html#a9d5d88148a26086567c3731e2e5e110a">   62</a></span>&#160;<span class="preprocessor"></span><span class="preprocessor">#define CLONE_NEWCGROUP 0x02000000</span></div>
+<div class="line"><a name="l00063"></a><span class="lineno">   63</span>&#160;<span class="preprocessor"></span><span class="preprocessor">#endif</span></div>
+<div class="line"><a name="l00064"></a><span class="lineno">   64</span>&#160;<span class="preprocessor"></span></div>
+<div class="line"><a name="l00065"></a><span class="lineno">   65</span>&#160;<span class="comment">// Define a &#39;setns&#39; for compilation environments that don&#39;t already</span></div>
+<div class="line"><a name="l00066"></a><span class="lineno">   66</span>&#160;<span class="comment">// have one.</span></div>
+<div class="line"><a name="l00067"></a><span class="lineno"><a class="line" href="ns_8hpp.html#a9aa5c2738ac9781ed9cd8202d87fb089">   67</a></span>&#160;<span class="keyword">inline</span> <span class="keywordtype">int</span> <a class="code" href="ns_8hpp.html#a9aa5c2738ac9781ed9cd8202d87fb089">setns</a>(<span class="keywordtype">int</span> fd, <span class="keywordtype">int</span> <a class="code" href="namespacens.html#a1c4fd4fd04bde294d2d7477dfee8427e">nstype</a>)</div>
+<div class="line"><a name="l00068"></a><span class="lineno">   68</span>&#160;{</div>
+<div class="line"><a name="l00069"></a><span class="lineno">   69</span>&#160;<span class="preprocessor">#ifdef SYS_setns</span></div>
+<div class="line"><a name="l00070"></a><span class="lineno">   70</span>&#160;<span class="preprocessor"></span>  return ::syscall(SYS_setns, fd, nstype);</div>
+<div class="line"><a name="l00071"></a><span class="lineno">   71</span>&#160;<span class="preprocessor">#elif defined(__x86_64__)</span></div>
+<div class="line"><a name="l00072"></a><span class="lineno">   72</span>&#160;<span class="preprocessor"></span>  <span class="comment">// A workaround for those hosts that have an old glibc (older than</span></div>
+<div class="line"><a name="l00073"></a><span class="lineno">   73</span>&#160;  <span class="comment">// 2.14) but have a new kernel. The magic number &#39;308&#39; here is the</span></div>
+<div class="line"><a name="l00074"></a><span class="lineno">   74</span>&#160;  <span class="comment">// syscall number for &#39;setns&#39; on x86_64 architecture.</span></div>
+<div class="line"><a name="l00075"></a><span class="lineno">   75</span>&#160;  return ::syscall(308, fd, nstype);</div>
+<div class="line"><a name="l00076"></a><span class="lineno">   76</span>&#160;<span class="preprocessor">#else</span></div>
+<div class="line"><a name="l00077"></a><span class="lineno">   77</span>&#160;<span class="preprocessor"></span><span class="preprocessor">#error &quot;setns is not available&quot;</span></div>
 <div class="line"><a name="l00078"></a><span class="lineno">   78</span>&#160;<span class="preprocessor"></span><span class="preprocessor">#endif</span></div>
-<div class="line"><a name="l00079"></a><span class="lineno">   79</span>&#160;<span class="preprocessor"></span></div>
-<div class="line"><a name="l00080"></a><span class="lineno">   80</span>&#160;<span class="preprocessor">#ifndef CLONE_NEWCGROUP</span></div>
-<div class="line"><a name="l00081"></a><span class="lineno"><a class="line" href="ns_8hpp.html#a9d5d88148a26086567c3731e2e5e110a">   81</a></span>&#160;<span class="preprocessor"></span><span class="preprocessor">#define CLONE_NEWCGROUP 0x02000000</span></div>
-<div class="line"><a name="l00082"></a><span class="lineno">   82</span>&#160;<span class="preprocessor"></span><span class="preprocessor">#endif</span></div>
-<div class="line"><a name="l00083"></a><span class="lineno">   83</span>&#160;<span class="preprocessor"></span></div>
-<div class="line"><a name="l00084"></a><span class="lineno">   84</span>&#160;<span class="comment">// Define a &#39;setns&#39; for compilation environments that don&#39;t already</span></div>
-<div class="line"><a name="l00085"></a><span class="lineno">   85</span>&#160;<span class="comment">// have one.</span></div>
-<div class="line"><a name="l00086"></a><span class="lineno"><a class="line" href="ns_8hpp.html#a9aa5c2738ac9781ed9cd8202d87fb089">   86</a></span>&#160;<span class="keyword">inline</span> <span class="keywordtype">int</span> <a class="code" href="ns_8hpp.html#a9aa5c2738ac9781ed9cd8202d87fb089">setns</a>(<span class="keywordtype">int</span> fd, <span class="keywordtype">int</span> <a class="code" href="namespacens.html#a1c4fd4fd04bde294d2d7477dfee8427e">nstype</a>)</div>
-<div class="line"><a name="l00087"></a><span class="lineno">   87</span>&#160;{</div>
-<div class="line"><a name="l00088"></a><span class="lineno">   88</span>&#160;<span class="preprocessor">#ifdef SYS_setns</span></div>
-<div class="line"><a name="l00089"></a><span class="lineno">   89</span>&#160;<span class="preprocessor"></span>  return ::syscall(SYS_setns, fd, nstype);</div>
-<div class="line"><a name="l00090"></a><span class="lineno">   90</span>&#160;<span class="preprocessor">#elif defined(__x86_64__)</span></div>
-<div class="line"><a name="l00091"></a><span class="lineno">   91</span>&#160;<span class="preprocessor"></span>  <span class="comment">// A workaround for those hosts that have an old glibc (older than</span></div>
-<div class="line"><a name="l00092"></a><span class="lineno">   92</span>&#160;  <span class="comment">// 2.14) but have a new kernel. The magic number &#39;308&#39; here is the</span></div>
-<div class="line"><a name="l00093"></a><span class="lineno">   93</span>&#160;  <span class="comment">// syscall number for &#39;setns&#39; on x86_64 architecture.</span></div>
-<div class="line"><a name="l00094"></a><span class="lineno">   94</span>&#160;  return ::syscall(308, fd, nstype);</div>
-<div class="line"><a name="l00095"></a><span class="lineno">   95</span>&#160;<span class="preprocessor">#else</span></div>
-<div class="line"><a name="l00096"></a><span class="lineno">   96</span>&#160;<span class="preprocessor"></span><span class="preprocessor">#error &quot;setns is not available&quot;</span></div>
-<div class="line"><a name="l00097"></a><span class="lineno">   97</span>&#160;<span class="preprocessor"></span><span class="preprocessor">#endif</span></div>
-<div class="line"><a name="l00098"></a><span class="lineno">   98</span>&#160;<span class="preprocessor"></span>}</div>
-<div class="line"><a name="l00099"></a><span class="lineno">   99</span>&#160;</div>
-<div class="line"><a name="l00100"></a><span class="lineno"><a class="line" href="namespacens.html">  100</a></span>&#160;<span class="keyword">namespace </span>ns {</div>
-<div class="line"><a name="l00101"></a><span class="lineno">  101</span>&#160;</div>
-<div class="line"><a name="l00102"></a><span class="lineno">  102</span>&#160;<span class="comment">// Returns the nstype (e.g., CLONE_NEWNET, CLONE_NEWNS, etc.) for the</span></div>
-<div class="line"><a name="l00103"></a><span class="lineno">  103</span>&#160;<span class="comment">// given namespace which can be used when calling ::setns.</span></div>
-<div class="line"><a name="l00104"></a><span class="lineno"><a class="line" href="namespacens.html#a1c4fd4fd04bde294d2d7477dfee8427e">  104</a></span>&#160;<span class="keyword">inline</span> <a class="code" href="classTry.html">Try&lt;int&gt;</a> <a class="code" href="namespacens.html#a1c4fd4fd04bde294d2d7477dfee8427e">nstype</a>(<span class="keyword">const</span> std::string&amp; ns)</div>
-<div class="line"><a name="l00105"></a><span class="lineno">  105</span>&#160;{</div>
-<div class="line"><a name="l00106"></a><span class="lineno">  106</span>&#160;  <span class="keyword">const</span> <a class="code" href="classhashmap.html">hashmap&lt;std::string, int&gt;</a> <a class="code" href="namespacens.html#ae308e5fb79986971a85717365f2258d4">nstypes</a> = {</div>
-<div class="line"><a name="l00107"></a><span class="lineno">  107</span>&#160;    {<span class="stringliteral">&quot;mnt&quot;</span>, <a class="code" href="ns_8hpp.html#aab02ccd05c3d9fa806d974e38a8debc4">CLONE_NEWNS</a>},</div>
-<div class="line"><a name="l00108"></a><span class="lineno">  108</span>&#160;    {<span class="stringliteral">&quot;uts&quot;</span>, <a class="code" href="ns_8hpp.html#afaf1addd4b1e90196d1876896c1a53c3">CLONE_NEWUTS</a>},</div>
-<div class="line"><a name="l00109"></a><span class="lineno">  109</span>&#160;    {<span class="stringliteral">&quot;ipc&quot;</span>, <a class="code" href="ns_8hpp.html#a1f702bf1b80ed7a8cef30e363a87e3e3">CLONE_NEWIPC</a>},</div>
-<div class="line"><a name="l00110"></a><span class="lineno">  110</span>&#160;    {<span class="stringliteral">&quot;net&quot;</span>, <a class="code" href="ns_8hpp.html#a2ba1673aa7423b46a7bcfa8f68cd2bce">CLONE_NEWNET</a>},</div>
-<div class="line"><a name="l00111"></a><span class="lineno">  111</span>&#160;    {<span class="stringliteral">&quot;user&quot;</span>, <a class="code" href="ns_8hpp.html#a5d697cae6f0156524a1bd7d77bcf8e87">CLONE_NEWUSER</a>},</div>
-<div class="line"><a name="l00112"></a><span class="lineno">  112</span>&#160;    {<span class="stringliteral">&quot;pid&quot;</span>, <a class="code" href="ns_8hpp.html#a2fa6801173606dd3492ca9061d1c4ad4">CLONE_NEWPID</a>},</div>
-<div class="line"><a name="l00113"></a><span class="lineno">  113</span>&#160;    {<span class="stringliteral">&quot;cgroup&quot;</span>, <a class="code" href="ns_8hpp.html#a9d5d88148a26086567c3731e2e5e110a">CLONE_NEWCGROUP</a>}</div>
-<div class="line"><a name="l00114"></a><span class="lineno">  114</span>&#160;  };</div>
-<div class="line"><a name="l00115"></a><span class="lineno">  115</span>&#160;</div>
-<div class="line"><a name="l00116"></a><span class="lineno">  116</span>&#160;  <a class="code" href="classOption.html">Option&lt;int&gt;</a> <a class="code" href="namespacens.html#a1c4fd4fd04bde294d2d7477dfee8427e">nstype</a> = nstypes.<a class="code" href="classhashmap.html#a41f14039c11b5a1ab6c81add74192c9a">get</a>(ns);</div>
-<div class="line"><a name="l00117"></a><span class="lineno">  117</span>&#160;</div>
-<div class="line"><a name="l00118"></a><span class="lineno">  118</span>&#160;  <span class="keywordflow">if</span> (nstype.<a class="code" href="classOption.html#a06eab791122ebc1f8af4ad310e5e7d7e">isNone</a>()) {</div>
-<div class="line"><a name="l00119"></a><span class="lineno">  119</span>&#160;    <span class="keywordflow">return</span> <a class="code" href="classError.html">Error</a>(<span class="stringliteral">&quot;Unknown namespace &#39;&quot;</span> + ns + <span class="stringliteral">&quot;&#39;&quot;</span>);</div>
-<div class="line"><a name="l00120"></a><span class="lineno">  120</span>&#160;  }</div>
-<div class="line"><a name="l00121"></a><span class="lineno">  121</span>&#160;</div>
-<div class="line"><a name="l00122"></a><span class="lineno">  122</span>&#160;  <span class="keywordflow">return</span> nstype.<a class="code" href="classOption.html#a21358442c0fac1cc978a67a9a9089a79">get</a>();</div>
-<div class="line"><a name="l00123"></a><span class="lineno">  123</span>&#160;}</div>
-<div class="line"><a name="l00124"></a><span class="lineno">  124</span>&#160;</div>
-<div class="line"><a name="l00125"></a><span class="lineno">  125</span>&#160;</div>
-<div class="line"><a name="l00126"></a><span class="lineno">  126</span>&#160;<span class="comment">// Returns all the supported namespaces by the kernel.</span></div>
-<div class="line"><a name="l00127"></a><span class="lineno"><a class="line" href="namespacens.html#aab01ae26d9da2efc741aa838c69db6e2">  127</a></span>&#160;<span class="keyword">inline</span> std::set&lt;std::string&gt; <a class="code" href="namespacens.html#aab01ae26d9da2efc741aa838c69db6e2">namespaces</a>()</div>
-<div class="line"><a name="l00128"></a><span class="lineno">  128</span>&#160;{</div>
-<div class="line"><a name="l00129"></a><span class="lineno">  129</span>&#160;  std::set&lt;std::string&gt; result;</div>
-<div class="line"><a name="l00130"></a><span class="lineno">  130</span>&#160;  <a class="code" href="classTry.html">Try&lt;std::list&lt;std::string&gt;</a>&gt; entries = <a class="code" href="namespaceos.html#a5effa5ea3568d8c18e5c66039702dfa0">os::ls</a>(<span class="stringliteral">&quot;/proc/self/ns&quot;</span>);</div>
-<div class="line"><a name="l00131"></a><span class="lineno">  131</span>&#160;  <span class="keywordflow">if</span> (entries.<a class="code" href="classTry.html#a6543d7d5db4f298bcd673bf3cd509acc">isSome</a>()) {</div>
-<div class="line"><a name="l00132"></a><span class="lineno">  132</span>&#160;    <span class="keywordflow">foreach</span> (<span class="keyword">const</span> std::string&amp; entry, entries.<a class="code" href="classTry.html#a7be0768038e0628632492edf6cc1515a">get</a>()) {</div>
-<div class="line"><a name="l00133"></a><span class="lineno">  133</span>&#160;      <span class="comment">// Introduced in Linux 4.12, pid_for_children is a handle for the PID</span></div>
-<div class="line"><a name="l00134"></a><span class="lineno">  134</span>&#160;      <span class="comment">// namespace of child processes created by the current process.</span></div>
-<div class="line"><a name="l00135"></a><span class="lineno">  135</span>&#160;      <span class="keywordflow">if</span> (entry != <span class="stringliteral">&quot;pid_for_children&quot;</span>) {</div>
-<div class="line"><a name="l00136"></a><span class="lineno">  136</span>&#160;        result.insert(entry);</div>
-<div class="line"><a name="l00137"></a><span class="lineno">  137</span>&#160;      }</div>
-<div class="line"><a name="l00138"></a><span class="lineno">  138</span>&#160;    }</div>
-<div class="line"><a name="l00139"></a><span class="lineno">  139</span>&#160;  }</div>
-<div class="line"><a name="l00140"></a><span class="lineno">  140</span>&#160;  <span class="keywordflow">return</span> result;</div>
-<div class="line"><a name="l00141"></a><span class="lineno">  141</span>&#160;}</div>
-<div class="line"><a name="l00142"></a><span class="lineno">  142</span>&#160;</div>
-<div class="line"><a name="l00143"></a><span class="lineno">  143</span>&#160;</div>
-<div class="line"><a name="l00144"></a><span class="lineno">  144</span>&#160;<span class="comment">// Returns all the supported namespaces by the kernel.</span></div>
-<div class="line"><a name="l00145"></a><span class="lineno"><a class="line" href="namespacens.html#ae308e5fb79986971a85717365f2258d4">  145</a></span>&#160;<span class="keyword">inline</span> std::set&lt;int&gt; <a class="code" href="namespacens.html#ae308e5fb79986971a85717365f2258d4">nstypes</a>()</div>
-<div class="line"><a name="l00146"></a><span class="lineno">  146</span>&#160;{</div>
-<div class="line"><a name="l00147"></a><span class="lineno">  147</span>&#160;  std::set&lt;int&gt; result;</div>
-<div class="line"><a name="l00148"></a><span class="lineno">  148</span>&#160;  <span class="keywordflow">foreach</span> (<span class="keyword">const</span> std::string&amp; ns, <a class="code" href="namespacens.html#aab01ae26d9da2efc741aa838c69db6e2">namespaces</a>()) {</div>
-<div class="line"><a name="l00149"></a><span class="lineno">  149</span>&#160;    <a class="code" href="classTry.html">Try&lt;int&gt;</a> <a class="code" href="namespacemesos_1_1internal_1_1fs.html#a2343e2642db514496ba8380776487fba">type</a> = <a class="code" href="namespacens.html#a1c4fd4fd04bde294d2d7477dfee8427e">nstype</a>(ns);</div>
-<div class="line"><a name="l00150"></a><span class="lineno">  150</span>&#160;    <span class="keywordflow">if</span> (type.<a class="code" href="classTry.html#a6543d7d5db4f298bcd673bf3cd509acc">isSome</a>()) {</div>
-<div class="line"><a name="l00151"></a><span class="lineno">  151</span>&#160;      result.insert(type.<a class="code" href="classTry.html#a7be0768038e0628632492edf6cc1515a">get</a>());</div>
-<div class="line"><a name="l00152"></a><span class="lineno">  152</span>&#160;    }</div>
-<div class="line"><a name="l00153"></a><span class="lineno">  153</span>&#160;  }</div>
-<div class="line"><a name="l00154"></a><span class="lineno">  154</span>&#160;  <span class="keywordflow">return</span> result;</div>
-<div class="line"><a name="l00155"></a><span class="lineno">  155</span>&#160;}</div>
-<div class="line"><a name="l00156"></a><span class="lineno">  156</span>&#160;</div>
-<div class="line"><a name="l00157"></a><span class="lineno">  157</span>&#160;</div>
-<div class="line"><a name="l00158"></a><span class="lineno">  158</span>&#160;<span class="comment">// Re-associate the calling process with the specified namespace. The</span></div>
-<div class="line"><a name="l00159"></a><span class="lineno">  159</span>&#160;<span class="comment">// path refers to one of the corresponding namespace entries in the</span></div>
-<div class="line"><a name="l00160"></a><span class="lineno">  160</span>&#160;<span class="comment">// /proc/[pid]/ns/ directory (or bind mounted elsewhere). We do not</span></div>
-<div class="line"><a name="l00161"></a><span class="lineno">  161</span>&#160;<span class="comment">// allow a process with multiple threads to call this function because</span></div>
-<div class="line"><a name="l00162"></a><span class="lineno">  162</span>&#160;<span class="comment">// it will lead to some weird situations where different threads of a</span></div>
-<div class="line"><a name="l00163"></a><span class="lineno">  163</span>&#160;<span class="comment">// process are in different namespaces.</span></div>
-<div class="line"><a name="l00164"></a><span class="lineno"><a class="line" href="namespacens.html#aff4db8d452eb5c8f07fba2ceeb5a7d83">  164</a></span>&#160;<span class="keyword">inline</span> <a class="code" href="classTry.html">Try&lt;Nothing&gt;</a> <a class="code" href="namespacens.html#aff4db8d452eb5c8f07fba2ceeb5a7d83">setns</a>(</div>
-<div class="line"><a name="l00165"></a><span class="lineno">  165</span>&#160;    <span class="keyword">const</span> std::string&amp; path,</div>
-<div class="line"><a name="l00166"></a><span class="lineno">  166</span>&#160;    <span class="keyword">const</span> std::string&amp; ns,</div>
-<div class="line"><a name="l00167"></a><span class="lineno">  167</span>&#160;    <span class="keywordtype">bool</span> checkMultithreaded = <span class="keyword">true</span>)</div>
-<div class="line"><a name="l00168"></a><span class="lineno">  168</span>&#160;{</div>
-<div class="line"><a name="l00169"></a><span class="lineno">  169</span>&#160;  <span class="keywordflow">if</span> (checkMultithreaded) {</div>
-<div class="line"><a name="l00170"></a><span class="lineno">  170</span>&#160;    <span class="comment">// Return error if there&#39;re multiple threads in the calling process.</span></div>
-<div class="line"><a name="l00171"></a><span class="lineno">  171</span>&#160;    <a class="code" href="classTry.html">Try&lt;std::set&lt;pid_t&gt;</a>&gt; <a class="code" href="namespacecgroups.html#a9fb61299862484ab2d1bd382ea109ca9">threads</a> = <a class="code" href="namespaceproc.html#a15bf23098084d86bb1f2ac75b863ec24">proc::threads</a>(::getpid());</div>
-<div class="line"><a name="l00172"></a><span class="lineno">  172</span>&#160;    <span class="keywordflow">if</span> (threads.<a class="code" href="classTry.html#a0b98f95163b8a38daafd1651b043a276">isError</a>()) {</div>
-<div class="line"><a name="l00173"></a><span class="lineno">  173</span>&#160;      <span class="keywordflow">return</span> <a class="code" href="classError.html">Error</a>(</div>
-<div class="line"><a name="l00174"></a><span class="lineno">  174</span>&#160;          <span class="stringliteral">&quot;Failed to get the threads of the current process: &quot;</span> +</div>
-<div class="line"><a name="l00175"></a><span class="lineno">  175</span>&#160;          threads.<a class="code" href="classTry.html#aec4a11ddd3c036e889d90b7eb6258ba7">error</a>());</div>
-<div class="line"><a name="l00176"></a><span class="lineno">  176</span>&#160;    } <span class="keywordflow">else</span> <span class="keywordflow">if</span> (threads.<a class="code" href="classTry.html#a7be0768038e0628632492edf6cc1515a">get</a>().size() &gt; 1) {</div>
-<div class="line"><a name="l00177"></a><span class="lineno">  177</span>&#160;      <span class="keywordflow">return</span> <a class="code" href="classError.html">Error</a>(<span class="stringliteral">&quot;Multiple threads exist in the current process&quot;</span>);</div>
-<div class="line"><a name="l00178"></a><span class="lineno">  178</span>&#160;    }</div>
-<div class="line"><a name="l00179"></a><span class="lineno">  179</span>&#160;  }</div>
-<div class="line"><a name="l00180"></a><span class="lineno">  180</span>&#160;</div>
-<div class="line"><a name="l00181"></a><span class="lineno">  181</span>&#160;  <span class="keywordflow">if</span> (<a class="code" href="namespacens.html#aab01ae26d9da2efc741aa838c69db6e2">ns::namespaces</a>().count(ns) == 0) {</div>
-<div class="line"><a name="l00182"></a><span class="lineno">  182</span>&#160;    <span class="keywordflow">return</span> <a class="code" href="classError.html">Error</a>(<span class="stringliteral">&quot;Namespace &#39;&quot;</span> + ns + <span class="stringliteral">&quot;&#39; is not supported&quot;</span>);</div>
-<div class="line"><a name="l00183"></a><span class="lineno">  183</span>&#160;  }</div>
-<div class="line"><a name="l00184"></a><span class="lineno">  184</span>&#160;</div>
-<div class="line"><a name="l00185"></a><span class="lineno">  185</span>&#160;  <span class="comment">// Currently, we don&#39;t support pid namespace as its semantics is</span></div>
-<div class="line"><a name="l00186"></a><span class="lineno">  186</span>&#160;  <span class="comment">// different from other namespaces (instead of re-associating the</span></div>
-<div class="line"><a name="l00187"></a><span class="lineno">  187</span>&#160;  <span class="comment">// calling thread, it re-associates the *children* of the calling</span></div>
-<div class="line"><a name="l00188"></a><span class="lineno">  188</span>&#160;  <span class="comment">// thread with the specified namespace).</span></div>
-<div class="line"><a name="l00189"></a><span class="lineno">  189</span>&#160;  <span class="keywordflow">if</span> (ns == <span class="stringliteral">&quot;pid&quot;</span>) {</div>
-<div class="line"><a name="l00190"></a><span class="lineno">  190</span>&#160;    <span class="keywordflow">return</span> <a class="code" href="classError.html">Error</a>(<span class="stringliteral">&quot;Pid namespace is not supported&quot;</span>);</div>
-<div class="line"><a name="l00191"></a><span class="lineno">  191</span>&#160;  }</div>
-<div class="line"><a name="l00192"></a><span class="lineno">  192</span>&#160;</div>
-<div class="line"><a name="l00193"></a><span class="lineno">  193</span>&#160;  <a class="code" href="classTry.html">Try&lt;int&gt;</a> fd = <a class="code" href="namespaceos.html#abbdbbbe902fd8dc271077d94b99994e7">os::open</a>(path, <a class="code" href="windows_2fcntl_8hpp.html#a7a68c9ffaac7dbcd652225dd7c06a54b">O_RDONLY</a> | <a class="code" href="windows_2fcntl_8hpp.html#ad6d8fbe4e494b4dbe051612572d3f757">O_CLOEXEC</a>);</div>
-<div class="line"><a name="l00194"></a><span class="lineno">  194</span>&#160;</div>
-<div class="line"><a name="l00195"></a><span class="lineno">  195</span>&#160;  <span class="keywordflow">if</span> (fd.<a class="code" href="classTry.html#a0b98f95163b8a38daafd1651b043a276">isError</a>()) {</div>
-<div class="line"><a name="l00196"></a><span class="lineno">  196</span>&#160;    <span class="keywordflow">return</span> <a class="code" href="classError.html">Error</a>(<span class="stringliteral">&quot;Failed to open &#39;&quot;</span> + path + <span class="stringliteral">&quot;&#39;: &quot;</span> + fd.<a class="code" href="classTry.html#aec4a11ddd3c036e889d90b7eb6258ba7">error</a>());</div>
-<div class="line"><a name="l00197"></a><span class="lineno">  197</span>&#160;  }</div>
-<div class="line"><a name="l00198"></a><span class="lineno">  198</span>&#160;</div>
-<div class="line"><a name="l00199"></a><span class="lineno">  199</span>&#160;  <a class="code" href="classTry.html">Try&lt;int&gt;</a> <a class="code" href="namespacens.html#a1c4fd4fd04bde294d2d7477dfee8427e">nstype</a> = <a class="code" href="namespacens.html#a1c4fd4fd04bde294d2d7477dfee8427e">ns::nstype</a>(ns);</div>
-<div class="line"><a name="l00200"></a><span class="lineno">  200</span>&#160;  <span class="keywordflow">if</span> (nstype.<a class="code" href="classTry.html#a0b98f95163b8a38daafd1651b043a276">isError</a>()) {</div>
-<div class="line"><a name="l00201"></a><span class="lineno">  201</span>&#160;    <span class="keywordflow">return</span> <a class="code" href="classError.html">Error</a>(nstype.<a class="code" href="classTry.html#aec4a11ddd3c036e889d90b7eb6258ba7">error</a>());</div>
-<div class="line"><a name="l00202"></a><span class="lineno">  202</span>&#160;  }</div>
-<div class="line"><a name="l00203"></a><span class="lineno">  203</span>&#160;</div>
-<div class="line"><a name="l00204"></a><span class="lineno">  204</span>&#160;  <span class="keywordflow">if</span> (::<a class="code" href="namespacens.html#aff4db8d452eb5c8f07fba2ceeb5a7d83">setns</a>(fd.<a class="code" href="classTry.html#a7be0768038e0628632492edf6cc1515a">get</a>(), nstype.<a class="code" href="classTry.html#a7be0768038e0628632492edf6cc1515a">get</a>()) == -1) {</div>
-<div class="line"><a name="l00205"></a><span class="lineno">  205</span>&#160;    <span class="comment">// Save the errno as it might be overwritten by &#39;os::close&#39; below.</span></div>
-<div class="line"><a name="l00206"></a><span class="lineno">  206</span>&#160;    <a class="code" href="classErrnoError.html">ErrnoError</a> <a class="code" href="namespacemesos_1_1internal_1_1slave_1_1cni_1_1spec.html#ae58e703656ab4a1bd5d9870441236727">error</a>;</div>
-<div class="line"><a name="l00207"></a><span class="lineno">  207</span>&#160;    <a class="code" href="namespaceos.html#a8df77ec6d6b8d32d9b287a41bc74cfdc">os::close</a>(fd.<a class="code" href="classTry.html#a7be0768038e0628632492edf6cc1515a">get</a>());</div>
-<div class="line"><a name="l00208"></a><span class="lineno">  208</span>&#160;    <span class="keywordflow">return</span> <a class="code" href="namespacemesos_1_1internal_1_1slave_1_1cni_1_1spec.html#ae58e703656ab4a1bd5d9870441236727">error</a>;</div>
-<div class="line"><a name="l00209"></a><span class="lineno">  209</span>&#160;  }</div>
-<div class="line"><a name="l00210"></a><span class="lineno">  210</span>&#160;</div>
-<div class="line"><a name="l00211"></a><span class="lineno">  211</span>&#160;  <a class="code" href="namespaceos.html#a8df77ec6d6b8d32d9b287a41bc74cfdc">os::close</a>(fd.<a class="code" href="classTry.html#a7be0768038e0628632492edf6cc1515a">get</a>());</div>
-<div class="line"><a name="l00212"></a><span class="lineno">  212</span>&#160;  <span class="keywordflow">return</span> <a class="code" href="structNothing.html">Nothing</a>();</div>
-<div class="line"><a name="l00213"></a><span class="lineno">  213</span>&#160;}</div>
-<div class="line"><a name="l00214"></a><span class="lineno">  214</span>&#160;</div>
-<div class="line"><a name="l00215"></a><span class="lineno">  215</span>&#160;</div>
-<div class="line"><a name="l00216"></a><span class="lineno">  216</span>&#160;<span class="comment">// Re-associate the calling process with the specified namespace. The</span></div>
-<div class="line"><a name="l00217"></a><span class="lineno">  217</span>&#160;<span class="comment">// pid specifies the process whose namespace we will associate.</span></div>
-<div class="line"><a name="l00218"></a><span class="lineno"><a class="line" href="namespacens.html#a7e58011de0d8219645c27912fc3bc8f4">  218</a></span>&#160;<span class="keyword">inline</span> <a class="code" href="classTry.html">Try&lt;Nothing&gt;</a> <a class="code" href="namespacens.html#aff4db8d452eb5c8f07fba2ceeb5a7d83">setns</a>(<a class="code" href="3rdparty_2stout_2include_2stout_2windows_8hpp.html#ab03ced250ed239bc3b50b669493997f9">pid_t</a> pid, <span class="keyword">const</span> std::string&amp; ns)</div>
-<div class="line"><a name="l00219"></a><span class="lineno">  219</span>&#160;{</div>
-<div class="line"><a name="l00220"></a><span class="lineno">  220</span>&#160;  <span class="keywordflow">if</span> (!<a class="code" href="namespaceos.html#a69b3969276ffa4cb698b9431ee43bd7c">os::exists</a>(pid)) {</div>
-<div class="line"><a name="l00221"></a><span class="lineno">  221</span>&#160;    <span class="keywordflow">return</span> <a class="code" href="classError.html">Error</a>(<span class="stringliteral">&quot;Pid &quot;</span> + <a class="code" href="namespacens.html#a28116b46e6543597a11733424cd1aa20">stringify</a>(pid) + <span class="stringliteral">&quot; does not exist&quot;</span>);</div>
-<div class="line"><a name="l00222"></a><span class="lineno">  222</span>&#160;  }</div>
-<div class="line"><a name="l00223"></a><span class="lineno">  223</span>&#160;</div>
-<div class="line"><a name="l00224"></a><span class="lineno">  224</span>&#160;  std::string path = <a class="code" href="namespacepath.html#aa86b16a2171cec90bb3337930513ef0f">path::join</a>(<span class="stringliteral">&quot;/proc&quot;</span>, <a class="code" href="namespacens.html#a28116b46e6543597a11733424cd1aa20">stringify</a>(pid), <span class="stringliteral">&quot;ns&quot;</span>, ns);</div>
-<div class="line"><a name="l00225"></a><span class="lineno">  225</span>&#160;  <span class="keywordflow">if</span> (!<a class="code" href="namespaceos.html#a69b3969276ffa4cb698b9431ee43bd7c">os::exists</a>(path)) {</div>
-<div class="line"><a name="l00226"></a><span class="lineno">  226</span>&#160;    <span class="keywordflow">return</span> <a class="code" href="classError.html">Error</a>(<span class="stringliteral">&quot;Namespace &#39;&quot;</span> + ns + <span class="stringliteral">&quot;&#39; is not supported&quot;</span>);</div>
-<div class="line"><a name="l00227"></a><span class="lineno">  227</span>&#160;  }</div>
-<div class="line"><a name="l00228"></a><span class="lineno">  228</span>&#160;</div>
-<div class="line"><a name="l00229"></a><span class="lineno">  229</span>&#160;  <span class="keywordflow">return</span> <a class="code" href="namespacens.html#aff4db8d452eb5c8f07fba2ceeb5a7d83">ns::setns</a>(path, ns);</div>
-<div class="line"><a name="l00230"></a><span class="lineno">  230</span>&#160;}</div>
-<div class="line"><a name="l00231"></a><span class="lineno">  231</span>&#160;</div>
-<div class="line"><a name="l00232"></a><span class="lineno">  232</span>&#160;</div>
-<div class="line"><a name="l00233"></a><span class="lineno">  233</span>&#160;<span class="comment">// Get the inode number of the specified namespace for the specified</span></div>
-<div class="line"><a name="l00234"></a><span class="lineno">  234</span>&#160;<span class="comment">// pid. The inode number identifies the namespace and can be used for</span></div>
-<div class="line"><a name="l00235"></a><span class="lineno">  235</span>&#160;<span class="comment">// comparisons, i.e., two processes with the same inode for a given</span></div>
-<div class="line"><a name="l00236"></a><span class="lineno">  236</span>&#160;<span class="comment">// namespace type are in the same namespace.</span></div>
-<div class="line"><a name="l00237"></a><span class="lineno"><a class="line" href="namespacens.html#af7062fcbd23b06620cb66f129985658e">  237</a></span>&#160;<span class="keyword">inline</span> <a class="code" href="classResult.html">Result&lt;ino_t&gt;</a> <a class="code" href="namespacens.html#af7062fcbd23b06620cb66f129985658e">getns</a>(<a class="code" href="3rdparty_2stout_2include_2stout_2windows_8hpp.html#ab03ced250ed239bc3b50b669493997f9">pid_t</a> pid, <span class="keyword">const</span> std::string&amp; ns)</div>
-<div class="line"><a name="l00238"></a><span class="lineno">  238</span>&#160;{</div>
-<div class="line"><a name="l00239"></a><span class="lineno">  239</span>&#160;  <span class="keywordflow">if</span> (<a class="code" href="namespacens.html#aab01ae26d9da2efc741aa838c69db6e2">ns::namespaces</a>().count(ns) &lt; 1) {</div>
-<div class="line"><a name="l00240"></a><span class="lineno">  240</span>&#160;    <span class="keywordflow">return</span> <a class="code" href="classError.html">Error</a>(<span class="stringliteral">&quot;Namespace &#39;&quot;</span> + ns + <span class="stringliteral">&quot;&#39; is not supported&quot;</span>);</div>
-<div class="line"><a name="l00241"></a><span class="lineno">  241</span>&#160;  }</div>
-<div class="line"><a name="l00242"></a><span class="lineno">  242</span>&#160;</div>
-<div class="line"><a name="l00243"></a><span class="lineno">  243</span>&#160;  std::string path = <a class="code" href="namespacepath.html#aa86b16a2171cec90bb3337930513ef0f">path::join</a>(<span class="stringliteral">&quot;/proc&quot;</span>, <a class="code" href="namespacens.html#a28116b46e6543597a11733424cd1aa20">stringify</a>(pid), <span class="stringliteral">&quot;ns&quot;</span>, ns);</div>
-<div class="line"><a name="l00244"></a><span class="lineno">  244</span>&#160;  <span class="keyword">struct </span><a class="code" href="namespacecgroups.html#a78e3c7ca2e422779908eec45f859d757">stat</a> s;</div>
-<div class="line"><a name="l00245"></a><span class="lineno">  245</span>&#160;  <span class="keywordflow">if</span> (::<a class="code" href="namespacecgroups.html#a78e3c7ca2e422779908eec45f859d757">stat</a>(path.c_str(), &amp;s) &lt; 0) {</div>
-<div class="line"><a name="l00246"></a><span class="lineno">  246</span>&#160;    <span class="keywordflow">if</span> (errno == ENOENT) {</div>
-<div class="line"><a name="l00247"></a><span class="lineno">  247</span>&#160;      <span class="comment">// Process is gone.</span></div>
-<div class="line"><a name="l00248"></a><span class="lineno">  248</span>&#160;      <span class="keywordflow">return</span> <a class="code" href="structNone.html">None</a>();</div>
-<div class="line"><a name="l00249"></a><span class="lineno">  249</span>&#160;    } <span class="keywordflow">else</span> {</div>
-<div class="line"><a name="l00250"></a><span class="lineno">  250</span>&#160;      <span class="keywordflow">return</span> <a class="code" href="classErrnoError.html">ErrnoError</a>(<span class="stringliteral">&quot;Failed to stat &quot;</span> + ns + <span class="stringliteral">&quot; namespace handle&quot;</span></div>
-<div class="line"><a name="l00251"></a><span class="lineno">  251</span>&#160;                        <span class="stringliteral">&quot; for pid &quot;</span> + <a class="code" href="namespacens.html#a28116b46e6543597a11733424cd1aa20">stringify</a>(pid));</div>
-<div class="line"><a name="l00252"></a><span class="lineno">  252</span>&#160;    }</div>
-<div class="line"><a name="l00253"></a><span class="lineno">  253</span>&#160;  }</div>
-<div class="line"><a name="l00254"></a><span class="lineno">  254</span>&#160;</div>
-<div class="line"><a name="l00255"></a><span class="lineno">  255</span>&#160;  <span class="keywordflow">return</span> s.st_ino;</div>
-<div class="line"><a name="l00256"></a><span class="lineno">  256</span>&#160;}</div>
-<div class="line"><a name="l00257"></a><span class="lineno">  257</span>&#160;</div>
-<div class="line"><a name="l00258"></a><span class="lineno">  258</span>&#160;</div>
-<div class="line"><a name="l00259"></a><span class="lineno">  259</span>&#160;</div>
-<div class="line"><a name="l00298"></a><span class="lineno"><a class="line" href="namespacens.html#a98bf4d9e11d546326250997a6493f835">  298</a></span>&#160;<span class="keyword">inline</span> <a class="code" href="classTry.html">Try&lt;pid_t&gt;</a> <a class="code" href="namespacens.html#a98bf4d9e11d546326250997a6493f835">clone</a>(</div>
-<div class="line"><a name="l00299"></a><span class="lineno">  299</span>&#160;    <a class="code" href="3rdparty_2stout_2include_2stout_2windows_8hpp.html#ab03ced250ed239bc3b50b669493997f9">pid_t</a> target,</div>
-<div class="line"><a name="l00300"></a><span class="lineno">  300</span>&#160;    <span class="keywordtype">int</span> <a class="code" href="namespacens.html#ae308e5fb79986971a85717365f2258d4">nstypes</a>,</div>
-<div class="line"><a name="l00301"></a><span class="lineno">  301</span>&#160;    <span class="keyword">const</span> lambda::function&lt;<span class="keywordtype">int</span>()&gt;&amp; <a class="code" href="namespaceprocess.html#a62d5333e8ec1817c249cf83e15d568b4">f</a>,</div>
-<div class="line"><a name="l00302"></a><span class="lineno">  302</span>&#160;    <span class="keywordtype">int</span> <a class="code" href="decoder_8hpp.html#abb0829cce9dd20a40ae0d86890ae85c6">flags</a>)</div>
-<div class="line"><a name="l00303"></a><span class="lineno">  303</span>&#160;{</div>
-<div class="line"><a name="l00304"></a><span class="lineno">  304</span>&#160;  <span class="comment">// NOTE: the order in which we &#39;setns&#39; is significant, so we use an</span></div>
-<div class="line"><a name="l00305"></a><span class="lineno">  305</span>&#160;  <span class="comment">// array here rather than something like a map.</span></div>
-<div class="line"><a name="l00306"></a><span class="lineno">  306</span>&#160;  <span class="comment">//</span></div>
-<div class="line"><a name="l00307"></a><span class="lineno">  307</span>&#160;  <span class="comment">// The user namespace needs to be entered first if we need to</span></div>
-<div class="line"><a name="l00308"></a><span class="lineno">  308</span>&#160;  <span class="comment">// increase the privilege and last if we want to decrease the</span></div>
-<div class="line"><a name="l00309"></a><span class="lineno">  309</span>&#160;  <span class="comment">// privilege. Said another way, entering the user namespace first</span></div>
-<div class="line"><a name="l00310"></a><span class="lineno">  310</span>&#160;  <span class="comment">// gives an unprivileged user the potential to enter the other</span></div>
-<div class="line"><a name="l00311"></a><span class="lineno">  311</span>&#160;  <span class="comment">// namespaces.</span></div>
-<div class="line"><a name="l00312"></a><span class="lineno">  312</span>&#160;  <span class="keyword">const</span> <span class="keywordtype">size_t</span> NAMESPACES = 7;</div>
-<div class="line"><a name="l00313"></a><span class="lineno">  313</span>&#160;  <span class="keyword">struct</span></div>
-<div class="line"><a name="l00314"></a><span class="lineno">  314</span>&#160;  {</div>
-<div class="line"><a name="l00315"></a><span class="lineno">  315</span>&#160;    <span class="keywordtype">int</span> <a class="code" href="namespacens.html#a1c4fd4fd04bde294d2d7477dfee8427e">nstype</a>;</div>
-<div class="line"><a name="l00316"></a><span class="lineno">  316</span>&#160;    std::string <a class="code" href="namespaceos_1_1Shell.html#acfe16ef2b1146ad49a8651c0a457ce46">name</a>;</div>
-<div class="line"><a name="l00317"></a><span class="lineno">  317</span>&#160;  } <a class="code" href="namespacens.html#aab01ae26d9da2efc741aa838c69db6e2">namespaces</a>[NAMESPACES] = {</div>
-<div class="line"><a name="l00318"></a><span class="lineno">  318</span>&#160;    {<a class="code" href="ns_8hpp.html#a5d697cae6f0156524a1bd7d77bcf8e87">CLONE_NEWUSER</a>, <span class="stringliteral">&quot;user&quot;</span>},</div>
-<div class="line"><a name="l00319"></a><span class="lineno">  319</span>&#160;    {<a class="code" href="ns_8hpp.html#a9d5d88148a26086567c3731e2e5e110a">CLONE_NEWCGROUP</a>, <span class="stringliteral">&quot;cgroup&quot;</span>},</div>
-<div class="line"><a name="l00320"></a><span class="lineno">  320</span>&#160;    {<a class="code" href="ns_8hpp.html#a1f702bf1b80ed7a8cef30e363a87e3e3">CLONE_NEWIPC</a>, <span class="stringliteral">&quot;ipc&quot;</span>},</div>
-<div class="line"><a name="l00321"></a><span class="lineno">  321</span>&#160;    {<a class="code" href="ns_8hpp.html#afaf1addd4b1e90196d1876896c1a53c3">CLONE_NEWUTS</a>, <span class="stringliteral">&quot;uts&quot;</span>},</div>
-<div class="line"><a name="l00322"></a><span class="lineno">  322</span>&#160;    {<a class="code" href="ns_8hpp.html#a2ba1673aa7423b46a7bcfa8f68cd2bce">CLONE_NEWNET</a>, <span class="stringliteral">&quot;net&quot;</span>},</div>
-<div class="line"><a name="l00323"></a><span class="lineno">  323</span>&#160;    {<a class="code" href="ns_8hpp.html#a2fa6801173606dd3492ca9061d1c4ad4">CLONE_NEWPID</a>, <span class="stringliteral">&quot;pid&quot;</span>},</div>
-<div class="line"><a name="l00324"></a><span class="lineno">  324</span>&#160;    {<a class="code" href="ns_8hpp.html#aab02ccd05c3d9fa806d974e38a8debc4">CLONE_NEWNS</a>, <span class="stringliteral">&quot;mnt&quot;</span>}</div>
-<div class="line"><a name="l00325"></a><span class="lineno">  325</span>&#160;  };</div>
-<div class="line"><a name="l00326"></a><span class="lineno">  326</span>&#160;</div>
-<div class="line"><a name="l00327"></a><span class="lineno">  327</span>&#160;  <span class="comment">// Support for user namespaces in all filesystems is incomplete</span></div>
-<div class="line"><a name="l00328"></a><span class="lineno">  328</span>&#160;  <span class="comment">// until version 3.12 (see &#39;Availability&#39; in man page of</span></div>
-<div class="line"><a name="l00329"></a><span class="lineno">  329</span>&#160;  <span class="comment">// &#39;user_namespaces&#39;), so for now we don&#39;t support entering them.</span></div>
-<div class="line"><a name="l00330"></a><span class="lineno">  330</span>&#160;  <span class="comment">//</span></div>
-<div class="line"><a name="l00331"></a><span class="lineno">  331</span>&#160;  <span class="comment">// TODO(benh): Support user namespaces if the current system can</span></div>
-<div class="line"><a name="l00332"></a><span class="lineno">  332</span>&#160;  <span class="comment">// support it, e.g., check the kernel version number or try and do a</span></div>
-<div class="line"><a name="l00333"></a><span class="lineno">  333</span>&#160;  <span class="comment">// clone with CLONE_NEWUSER to see if it works. NOTE: before we can</span></div>
-<div class="line"><a name="l00334"></a><span class="lineno">  334</span>&#160;  <span class="comment">// fully support user namespaces, however, we must take care to</span></div>
-<div class="line"><a name="l00335"></a><span class="lineno">  335</span>&#160;  <span class="comment">// either enter the user namespace first or last. We&#39;ll want to</span></div>
-<div class="line"><a name="l00336"></a><span class="lineno">  336</span>&#160;  <span class="comment">// enter it first if we need to increase the privilege and last if</span></div>
-<div class="line"><a name="l00337"></a><span class="lineno">  337</span>&#160;  <span class="comment">// we want to decrease the privilege. Currently nsenter.c from</span></div>
-<div class="line"><a name="l00338"></a><span class="lineno">  338</span>&#160;  <span class="comment">// utils-linux does this via doing two passes to make sure we either</span></div>
-<div class="line"><a name="l00339"></a><span class="lineno">  339</span>&#160;  <span class="comment">// enter first or last. We&#39;ll need to do something similar here once</span></div>
-<div class="line"><a name="l00340"></a><span class="lineno">  340</span>&#160;  <span class="comment">// we support user namespaces as well.</span></div>
-<div class="line"><a name="l00341"></a><span class="lineno">  341</span>&#160;  <span class="keywordflow">if</span> (nstypes &amp; <a class="code" href="ns_8hpp.html#a5d697cae6f0156524a1bd7d77bcf8e87">CLONE_NEWUSER</a>) {</div>
-<div class="line"><a name="l00342"></a><span class="lineno">  342</span>&#160;    <span class="keywordflow">return</span> <a class="code" href="classError.html">Error</a>(<span class="stringliteral">&quot;User namespaces are not supported&quot;</span>);</div>
-<div class="line"><a name="l00343"></a><span class="lineno">  343</span>&#160;  }</div>
-<div class="line"><a name="l00344"></a><span class="lineno">  344</span>&#160;</div>
-<div class="line"><a name="l00345"></a><span class="lineno">  345</span>&#160;  <span class="comment">// File descriptors keyed by the (parent) namespace we are entering.</span></div>
-<div class="line"><a name="l00346"></a><span class="lineno">  346</span>&#160;  <a class="code" href="classhashmap.html">hashmap&lt;int, int&gt;</a> fds = {};</div>
-<div class="line"><a name="l00347"></a><span class="lineno">  347</span>&#160;</div>
-<div class="line"><a name="l00348"></a><span class="lineno">  348</span>&#160;  <span class="comment">// Helper for closing a list of file descriptors.</span></div>
-<div class="line"><a name="l00349"></a><span class="lineno">  349</span>&#160;  <span class="keyword">auto</span> close = [](<span class="keyword">const</span> std::list&lt;int&gt;&amp; fds) {</div>
-<div class="line"><a name="l00350"></a><span class="lineno">  350</span>&#160;    <span class="keywordflow">foreach</span> (<span class="keywordtype">int</span> fd, fds) {</div>
-<div class="line"><a name="l00351"></a><span class="lineno">  351</span>&#160;      ::close(fd); <span class="comment">// Need to call the async-signal safe version.</span></div>
-<div class="line"><a name="l00352"></a><span class="lineno">  352</span>&#160;    }</div>
-<div class="line"><a name="l00353"></a><span class="lineno">  353</span>&#160;  };</div>
-<div class="line"><a name="l00354"></a><span class="lineno">  354</span>&#160;</div>
-<div class="line"><a name="l00355"></a><span class="lineno">  355</span>&#160;  <span class="comment">// NOTE: we do all of this ahead of time so we can be async signal</span></div>
-<div class="line"><a name="l00356"></a><span class="lineno">  356</span>&#160;  <span class="comment">// safe after calling fork below.</span></div>
-<div class="line"><a name="l00357"></a><span class="lineno">  357</span>&#160;  <span class="keywordflow">for</span> (<span class="keywordtype">size_t</span> i = 0; i &lt; NAMESPACES; i++) {</div>
-<div class="line"><a name="l00358"></a><span class="lineno">  358</span>&#160;    <span class="comment">// Only open the namespace file descriptor if it&#39;s been requested.</span></div>
-<div class="line"><a name="l00359"></a><span class="lineno">  359</span>&#160;    <span class="keywordflow">if</span> (<a class="code" href="namespacens.html#aab01ae26d9da2efc741aa838c69db6e2">namespaces</a>[i].<a class="code" href="namespacens.html#a1c4fd4fd04bde294d2d7477dfee8427e">nstype</a> &amp; nstypes) {</div>
-<div class="line"><a name="l00360"></a><span class="lineno">  360</span>&#160;      std::string path =</div>
-<div class="line"><a name="l00361"></a><span class="lineno">  361</span>&#160;        <a class="code" href="namespacepath.html#aa86b16a2171cec90bb3337930513ef0f">path::join</a>(<span class="stringliteral">&quot;/proc&quot;</span>, <a class="code" href="namespacens.html#a28116b46e6543597a11733424cd1aa20">stringify</a>(target), <span class="stringliteral">&quot;ns&quot;</span>, <a class="code" href="namespacens.html#aab01ae26d9da2efc741aa838c69db6e2">namespaces</a>[i].<a class="code" href="namespaceos_1_1Shell.html#acfe16ef2b1146ad49a8651c0a457ce46">name</a>);</div>
-<div class="line"><a name="l00362"></a><span class="lineno">  362</span>&#160;      <a class="code" href="classTry.html">Try&lt;int&gt;</a> fd = <a class="code" href="namespaceos.html#abbdbbbe902fd8dc271077d94b99994e7">os::open</a>(path, <a class="code" href="windows_2fcntl_8hpp.html#a7a68c9ffaac7dbcd652225dd7c06a54b">O_RDONLY</a>);</div>
-<div class="line"><a name="l00363"></a><span class="lineno">  363</span>&#160;      <span class="keywordflow">if</span> (fd.<a class="code" href="classTry.html#a0b98f95163b8a38daafd1651b043a276">isError</a>()) {</div>
-<div class="line"><a name="l00364"></a><span class="lineno">  364</span>&#160;        close(fds.<a class="code" href="classhashmap.html#a3e6a1fdf47dc2216eb8c0900e0bc969e">values</a>());</div>
-<div class="line"><a name="l00365"></a><span class="lineno">  365</span>&#160;        <span class="keywordflow">return</span> <a class="code" href="classError.html">Error</a>(<span class="stringliteral">&quot;Failed to open &#39;&quot;</span> + path +</div>
-<div class="line"><a name="l00366"></a><span class="lineno">  366</span>&#160;                     <span class="stringliteral">&quot;&#39; for entering namespace: &quot;</span> + fd.<a class="code" href="classTry.html#aec4a11ddd3c036e889d90b7eb6258ba7">error</a>());</div>
-<div class="line"><a name="l00367"></a><span class="lineno">  367</span>&#160;      }</div>
-<div class="line"><a name="l00368"></a><span class="lineno">  368</span>&#160;      fds[<a class="code" href="namespacens.html#aab01ae26d9da2efc741aa838c69db6e2">namespaces</a>[i].nstype] = fd.<a class="code" href="classTry.html#a7be0768038e0628632492edf6cc1515a">get</a>();</div>
-<div class="line"><a name="l00369"></a><span class="lineno">  369</span>&#160;    }</div>
-<div class="line"><a name="l00370"></a><span class="lineno">  370</span>&#160;  }</div>
-<div class="line"><a name="l00371"></a><span class="lineno">  371</span>&#160;</div>
-<div class="line"><a name="l00372"></a><span class="lineno">  372</span>&#160;  <span class="comment">// We use a domain socket rather than pipes so that we can send back</span></div>
-<div class="line"><a name="l00373"></a><span class="lineno">  373</span>&#160;  <span class="comment">// the PID of the final child process. The parent socket is</span></div>
-<div class="line"><a name="l00374"></a><span class="lineno">  374</span>&#160;  <span class="comment">// `sockets[0]` and the child socket is `sockets[1]`. Note that both</span></div>
-<div class="line"><a name="l00375"></a><span class="lineno">  375</span>&#160;  <span class="comment">// sockets are both read/write but currently only the parent reads</span></div>
-<div class="line"><a name="l00376"></a><span class="lineno">  376</span>&#160;  <span class="comment">// and the child writes.</span></div>
-<div class="line"><a name="l00377"></a><span class="lineno">  377</span>&#160;  <span class="keywordtype">int</span> sockets[2] = {-1, -1};</div>
-<div class="line"><a name="l00378"></a><span class="lineno">  378</span>&#160;  <span class="keywordflow">if</span> (socketpair(AF_UNIX, SOCK_STREAM, 0, sockets) != 0) {</div>
-<div class="line"><a name="l00379"></a><span class="lineno">  379</span>&#160;    close(fds.<a class="code" href="classhashmap.html#a3e6a1fdf47dc2216eb8c0900e0bc969e">values</a>());</div>
-<div class="line"><a name="l00380"></a><span class="lineno">  380</span>&#160;    <span class="keywordflow">return</span> <a class="code" href="classErrnoError.html">ErrnoError</a>(<span class="stringliteral">&quot;Failed to create Unix domain socket&quot;</span>);</div>
-<div class="line"><a name="l00381"></a><span class="lineno">  381</span>&#160;  }</div>
-<div class="line"><a name="l00382"></a><span class="lineno">  382</span>&#160;</div>
-<div class="line"><a name="l00383"></a><span class="lineno">  383</span>&#160;  <span class="comment">// Need to set SO_PASSCRED option in order to receive credentials</span></div>
-<div class="line"><a name="l00384"></a><span class="lineno">  384</span>&#160;  <span class="comment">// (which is how we get the pid of the clone&#39;d process, see</span></div>
-<div class="line"><a name="l00385"></a><span class="lineno">  385</span>&#160;  <span class="comment">// below). Note that apparently we only need to do this for</span></div>
-<div class="line"><a name="l00386"></a><span class="lineno">  386</span>&#160;  <span class="comment">// receiving, not also for sending.</span></div>
-<div class="line"><a name="l00387"></a><span class="lineno">  387</span>&#160;  <span class="keyword">const</span> <span class="keywordtype">int</span> value = 1;</div>
-<div class="line"><a name="l00388"></a><span class="lineno">  388</span>&#160;  <span class="keyword">const</span> <a class="code" href="3rdparty_2stout_2include_2stout_2windows_8hpp.html#a894c4d58faeee7675b9e7e8244de1386">ssize_t</a> <a class="code" href="namespaceos_1_1stat.html#a7a116891923bc8b5d8c50f78da8657be">size</a> = <span class="keyword">sizeof</span>(value);</div>
-<div class="line"><a name="l00389"></a><span class="lineno">  389</span>&#160;  <span class="keywordflow">if</span> (setsockopt(sockets[0], SOL_SOCKET, SO_PASSCRED, &amp;value, size) == -1) {</div>
-<div class="line"><a name="l00390"></a><span class="lineno">  390</span>&#160;    <a class="code" href="classError.html">Error</a> <a class="code" href="namespacemesos_1_1internal_1_1slave_1_1cni_1_1spec.html#ae58e703656ab4a1bd5d9870441236727">error</a> = <a class="code" href="classErrnoError.html">ErrnoError</a>(<span class="stringliteral">&quot;Failed to set socket option SO_PASSCRED&quot;</span>);</div>
-<div class="line"><a name="l00391"></a><span class="lineno">  391</span>&#160;    close(fds.<a class="code" href="classhashmap.html#a3e6a1fdf47dc2216eb8c0900e0bc969e">values</a>());</div>
-<div class="line"><a name="l00392"></a><span class="lineno">  392</span>&#160;    ::close(sockets[0]);</div>
-<div class="line"><a name="l00393"></a><span class="lineno">  393</span>&#160;    ::close(sockets[1]);</div>
-<div class="line"><a name="l00394"></a><span class="lineno">  394</span>&#160;    <span class="keywordflow">return</span> <a class="code" href="namespacemesos_1_1internal_1_1slave_1_1cni_1_1spec.html#ae58e703656ab4a1bd5d9870441236727">error</a>;</div>
-<div class="line"><a name="l00395"></a><span class="lineno">  395</span>&#160;  }</div>
-<div class="line"><a name="l00396"></a><span class="lineno">  396</span>&#160;</div>
-<div class="line"><a name="l00397"></a><span class="lineno">  397</span>&#160;  <span class="comment">// NOTE: to determine the pid of the final process executing the</span></div>
-<div class="line"><a name="l00398"></a><span class="lineno">  398</span>&#160;  <span class="comment">// specified lambda we use the SCM_CREDENTIALS mechanism of</span></div>
-<div class="line"><a name="l00399"></a><span class="lineno">  399</span>&#160;  <span class="comment">// &#39;sendmsg&#39; and &#39;recvmsg&#39;. On Linux there is also a way to do this</span></div>
-<div class="line"><a name="l00400"></a><span class="lineno">  400</span>&#160;  <span class="comment">// via &#39;getsockopt&#39; and SO_PEERCRED which looks easier, but IIUC</span></div>
-<div class="line"><a name="l00401"></a><span class="lineno">  401</span>&#160;  <span class="comment">// requires you to do an explicit connect from the child process</span></div>
-<div class="line"><a name="l00402"></a><span class="lineno">  402</span>&#160;  <span class="comment">// back to the parent so that there is only one connection per</span></div>
-<div class="line"><a name="l00403"></a><span class="lineno">  403</span>&#160;  <span class="comment">// socket (unlike in our world where the socket can be used by</span></div>
-<div class="line"><a name="l00404"></a><span class="lineno">  404</span>&#160;  <span class="comment">// multiple forks/clones simultaneously because it&#39;s just a file</span></div>
-<div class="line"><a name="l00405"></a><span class="lineno">  405</span>&#160;  <span class="comment">// descriptor that gets copied after each fork/clone). Perhaps the</span></div>
-<div class="line"><a name="l00406"></a><span class="lineno">  406</span>&#160;  <span class="comment">// SO_PEERCRED is less lines of code but this approach was taken for</span></div>
-<div class="line"><a name="l00407"></a><span class="lineno">  407</span>&#160;  <span class="comment">// now.</span></div>
-<div class="line"><a name="l00408"></a><span class="lineno">  408</span>&#160;</div>
-<div class="line"><a name="l00409"></a><span class="lineno">  409</span>&#160;  <span class="keywordtype">char</span> <a class="code" href="namespaceprocess.html#a373bd5e2bd8f2694e4589293af477854">base</a>[1];</div>
-<div class="line"><a name="l00410"></a><span class="lineno">  410</span>&#160;</div>
-<div class="line"><a name="l00411"></a><span class="lineno">  411</span>&#160;  iovec iov = {0};</div>
-<div class="line"><a name="l00412"></a><span class="lineno">  412</span>&#160;  iov.iov_base = <a class="code" href="namespaceprocess.html#a373bd5e2bd8f2694e4589293af477854">base</a>;</div>
-<div class="line"><a name="l00413"></a><span class="lineno">  413</span>&#160;  iov.iov_len = <span class="keyword">sizeof</span>(<a class="code" href="namespaceprocess.html#a373bd5e2bd8f2694e4589293af477854">base</a>);</div>
-<div class="line"><a name="l00414"></a><span class="lineno">  414</span>&#160;</div>
-<div class="line"><a name="l00415"></a><span class="lineno">  415</span>&#160;  <span class="comment">// Need to allocate a char array large enough to hold &quot;control&quot;</span></div>
-<div class="line"><a name="l00416"></a><span class="lineno">  416</span>&#160;  <span class="comment">// data. However, since this buffer is in reality a &#39;struct cmsghdr&#39;</span></div>
-<div class="line"><a name="l00417"></a><span class="lineno">  417</span>&#160;  <span class="comment">// we use a union to ensure that it is aligned as required for that</span></div>
-<div class="line"><a name="l00418"></a><span class="lineno">  418</span>&#160;  <span class="comment">// structure.</span></div>
-<div class="line"><a name="l00419"></a><span class="lineno">  419</span>&#160;  <span class="keyword">union </span>{</div>
-<div class="line"><a name="l00420"></a><span class="lineno">  420</span>&#160;    <span class="keyword">struct </span>cmsghdr cmessage;</div>
-<div class="line"><a name="l00421"></a><span class="lineno">  421</span>&#160;    <span class="keywordtype">char</span> control[CMSG_SPACE(<span class="keyword">sizeof</span>(<span class="keyword">struct</span> ucred))];</div>
-<div class="line"><a name="l00422"></a><span class="lineno">  422</span>&#160;  };</div>
-<div class="line"><a name="l00423"></a><span class="lineno">  423</span>&#160;</div>
-<div class="line"><a name="l00424"></a><span class="lineno">  424</span>&#160;  cmessage.cmsg_len = CMSG_LEN(<span class="keyword">sizeof</span>(<span class="keyword">struct</span> ucred));</div>
-<div class="line"><a name="l00425"></a><span class="lineno">  425</span>&#160;  cmessage.cmsg_level = SOL_SOCKET;</div>
-<div class="line"><a name="l00426"></a><span class="lineno">  426</span>&#160;  cmessage.cmsg_type = SCM_CREDENTIALS;</div>
-<div class="line"><a name="l00427"></a><span class="lineno">  427</span>&#160;</div>
-<div class="line"><a name="l00428"></a><span class="lineno">  428</span>&#160;  msghdr message = {0};</div>
-<div class="line"><a name="l00429"></a><span class="lineno">  429</span>&#160;  message.msg_name = <span class="keyword">nullptr</span>;</div>
-<div class="line"><a name="l00430"></a><span class="lineno">  430</span>&#160;  message.msg_namelen = 0;</div>
-<div class="line"><a name="l00431"></a><span class="lineno">  431</span>&#160;  message.msg_iov = &amp;iov;</div>
-<div class="line"><a name="l00432"></a><span class="lineno">  432</span>&#160;  message.msg_iovlen = 1;</div>
-<div class="line"><a name="l00433"></a><span class="lineno">  433</span>&#160;  message.msg_control = control;</div>
-<div class="line"><a name="l00434"></a><span class="lineno">  434</span>&#160;  message.msg_controllen = <span class="keyword">sizeof</span>(control); <span class="comment">// CMSG_LEN(sizeof(struct ucred));</span></div>
-<div class="line"><a name="l00435"></a><span class="lineno">  435</span>&#160;</div>
-<div class="line"><a name="l00436"></a><span class="lineno">  436</span>&#160;  <span class="comment">// Finally, the stack we&#39;ll use in the call to os::clone below (we</span></div>
-<div class="line"><a name="l00437"></a><span class="lineno">  437</span>&#160;  <span class="comment">// allocate the stack here in order to keep the call to os::clone</span></div>
-<div class="line"><a name="l00438"></a><span class="lineno">  438</span>&#160;  <span class="comment">// async signal safe, since otherwise it would be doing the dynamic</span></div>
-<div class="line"><a name="l00439"></a><span class="lineno">  439</span>&#160;  <span class="comment">// allocation itself).</span></div>
-<div class="line"><a name="l00440"></a><span class="lineno">  440</span>&#160;  <a class="code" href="classTry.html">Try&lt;os::Stack&gt;</a> stack = <a class="code" href="classos_1_1Stack.html#a248fb0d3d52e903c887890d0155f70b7">os::Stack::create</a>(<a class="code" href="classos_1_1Stack.html#af5c1f11af9592d666dd1705d5393d4d0">os::Stack::DEFAULT_SIZE</a>);</div>
-<div class="line"><a name="l00441"></a><span class="lineno">  441</span>&#160;  <span class="keywordflow">if</span> (stack.<a class="code" href="classTry.html#a0b98f95163b8a38daafd1651b043a276">isError</a>()) {</div>
-<div class="line"><a name="l00442"></a><span class="lineno">  442</span>&#160;    <span class="keywordflow">return</span> <a class="code" href="classError.html">Error</a>(<span class="stringliteral">&quot;Failed to allocate stack: &quot;</span> + stack.<a class="code" href="classTry.html#aec4a11ddd3c036e889d90b7eb6258ba7">error</a>());</div>
-<div class="line"><a name="l00443"></a><span class="lineno">  443</span>&#160;  }</div>
-<div class="line"><a name="l00444"></a><span class="lineno">  444</span>&#160;</div>
-<div class="line"><a name="l00445"></a><span class="lineno">  445</span>&#160;  <a class="code" href="3rdparty_2stout_2include_2stout_2windows_8hpp.html#ab03ced250ed239bc3b50b669493997f9">pid_t</a> child = fork();</div>
-<div class="line"><a name="l00446"></a><span class="lineno">  446</span>&#160;  <span class="keywordflow">if</span> (child &lt; 0) {</div>
-<div class="line"><a name="l00447"></a><span class="lineno">  447</span>&#160;    stack-&gt;<a class="code" href="classos_1_1Stack.html#aa5b0858e49e36141b299ef45e6d1b265">deallocate</a>();</div>
-<div class="line"><a name="l00448"></a><span class="lineno">  448</span>&#160;    close(fds.<a class="code" href="classhashmap.html#a3e6a1fdf47dc2216eb8c0900e0bc969e">values</a>());</div>
-<div class="line"><a name="l00449"></a><span class="lineno">  449</span>&#160;    ::close(sockets[0]);</div>
-<div class="line"><a name="l00450"></a><span class="lineno">  450</span>&#160;    ::close(sockets[1]);</div>
-<div class="line"><a name="l00451"></a><span class="lineno">  451</span>&#160;    <span class="keywordflow">return</span> <a class="code" href="classErrnoError.html">ErrnoError</a>();</div>
-<div class="line"><a name="l00452"></a><span class="lineno">  452</span>&#160;  } <span class="keywordflow">else</span> <span class="keywordflow">if</span> (child &gt; 0) {</div>
-<div class="line"><a name="l00453"></a><span class="lineno">  453</span>&#160;    <span class="comment">// Parent.</span></div>
-<div class="line"><a name="l00454"></a><span class="lineno">  454</span>&#160;    stack-&gt;<a class="code" href="classos_1_1Stack.html#aa5b0858e49e36141b299ef45e6d1b265">deallocate</a>();</div>
-<div class="line"><a name="l00455"></a><span class="lineno">  455</span>&#160;</div>
-<div class="line"><a name="l00456"></a><span class="lineno">  456</span>&#160;    close(fds.<a class="code" href="classhashmap.html#a3e6a1fdf47dc2216eb8c0900e0bc969e">values</a>());</div>
-<div class="line"><a name="l00457"></a><span class="lineno">  457</span>&#160;    ::close(sockets[1]);</div>
-<div class="line"><a name="l00458"></a><span class="lineno">  458</span>&#160;</div>
-<div class="line"><a name="l00459"></a><span class="lineno">  459</span>&#160;    <a class="code" href="3rdparty_2stout_2include_2stout_2windows_8hpp.html#a894c4d58faeee7675b9e7e8244de1386">ssize_t</a> length = recvmsg(sockets[0], &amp;message, 0);</div>
-<div class="line"><a name="l00460"></a><span class="lineno">  460</span>&#160;</div>
-<div class="line"><a name="l00461"></a><span class="lineno">  461</span>&#160;    <span class="comment">// TODO(benh): Note that whenever we &#39;kill(child, SIGKILL)&#39; below</span></div>
-<div class="line"><a name="l00462"></a><span class="lineno">  462</span>&#160;    <span class="comment">// we don&#39;t guarantee cleanup! It&#39;s possible that the</span></div>
-<div class="line"><a name="l00463"></a><span class="lineno">  463</span>&#160;    <span class="comment">// greatgrandchild is still running. Require the greatgrandchild</span></div>
-<div class="line"><a name="l00464"></a><span class="lineno">  464</span>&#160;    <span class="comment">// to read from the socket after sending back it&#39;s pid to ensure</span></div>
-<div class="line"><a name="l00465"></a><span class="lineno">  465</span>&#160;    <span class="comment">// no orphans.</span></div>
-<div class="line"><a name="l00466"></a><span class="lineno">  466</span>&#160;</div>
-<div class="line"><a name="l00467"></a><span class="lineno">  467</span>&#160;    <span class="keywordflow">if</span> (length &lt; 0) {</div>
-<div class="line"><a name="l00468"></a><span class="lineno">  468</span>&#160;      <span class="comment">// We failed to read, close the socket and kill the child</span></div>
-<div class="line"><a name="l00469"></a><span class="lineno">  469</span>&#160;      <span class="comment">// (which might die on it&#39;s own trying to write to the</span></div>
-<div class="line"><a name="l00470"></a><span class="lineno">  470</span>&#160;      <span class="comment">// socket).</span></div>
-<div class="line"><a name="l00471"></a><span class="lineno">  471</span>&#160;      <a class="code" href="classError.html">Error</a> <a class="code" href="namespacemesos_1_1internal_1_1slave_1_1cni_1_1spec.html#ae58e703656ab4a1bd5d9870441236727">error</a> = <a class="code" href="classErrnoError.html">ErrnoError</a>(<span class="stringliteral">&quot;Failed to receive&quot;</span>);</div>
-<div class="line"><a name="l00472"></a><span class="lineno">  472</span>&#160;      ::close(sockets[0]);</div>
-<div class="line"><a name="l00473"></a><span class="lineno">  473</span>&#160;      <a class="code" href="namespacecgroups.html#ab75e1e2d1be63eec907bf12306a7c8a7">kill</a>(child, <a class="code" href="3rdparty_2stout_2include_2stout_2windows_8hpp.html#a1c2b5693161bbc9d516ef5d16c7b54f5">SIGKILL</a>);</div>
-<div class="line"><a name="l00474"></a><span class="lineno">  474</span>&#160;      <span class="keywordflow">return</span> <a class="code" href="namespacemesos_1_1internal_1_1slave_1_1cni_1_1spec.html#ae58e703656ab4a1bd5d9870441236727">error</a>;</div>
-<div class="line"><a name="l00475"></a><span class="lineno">  475</span>&#160;    } <span class="keywordflow">else</span> <span class="keywordflow">if</span> (length == 0) {</div>
-<div class="line"><a name="l00476"></a><span class="lineno">  476</span>&#160;      <span class="comment">// Socket closed, child must have died, but kill anyway.</span></div>
-<div class="line"><a name="l00477"></a><span class="lineno">  477</span>&#160;      ::close(sockets[0]);</div>
-<div class="line"><a name="l00478"></a><span class="lineno">  478</span>&#160;      <a class="code" href="namespacecgroups.html#ab75e1e2d1be63eec907bf12306a7c8a7">kill</a>(child, <a class="code" href="3rdparty_2stout_2include_2stout_2windows_8hpp.html#a1c2b5693161bbc9d516ef5d16c7b54f5">SIGKILL</a>);</div>
-<div class="line"><a name="l00479"></a><span class="lineno">  479</span>&#160;      <span class="keywordflow">return</span> <a class="code" href="classError.html">Error</a>(<span class="stringliteral">&quot;Failed to receive: Socket closed&quot;</span>);</div>
-<div class="line"><a name="l00480"></a><span class="lineno">  480</span>&#160;    }</div>
-<div class="line"><a name="l00481"></a><span class="lineno">  481</span>&#160;</div>
-<div class="line"><a name="l00482"></a><span class="lineno">  482</span>&#160;    ::close(sockets[0]);</div>
-<div class="line"><a name="l00483"></a><span class="lineno">  483</span>&#160;</div>
-<div class="line"><a name="l00484"></a><span class="lineno">  484</span>&#160;    <span class="comment">// Extract pid.</span></div>
-<div class="line"><a name="l00485"></a><span class="lineno">  485</span>&#160;    <span class="keywordflow">if</span> (CMSG_FIRSTHDR(&amp;message) == <span class="keyword">nullptr</span> ||</div>
-<div class="line"><a name="l00486"></a><span class="lineno">  486</span>&#160;        CMSG_FIRSTHDR(&amp;message)-&gt;cmsg_len != CMSG_LEN(<span class="keyword">sizeof</span>(<span class="keyword">struct</span> ucred)) ||</div>
-<div class="line"><a name="l00487"></a><span class="lineno">  487</span>&#160;        CMSG_FIRSTHDR(&amp;message)-&gt;cmsg_level != SOL_SOCKET ||</div>
-<div class="line"><a name="l00488"></a><span class="lineno">  488</span>&#160;        CMSG_FIRSTHDR(&amp;message)-&gt;cmsg_type != SCM_CREDENTIALS) {</div>
-<div class="line"><a name="l00489"></a><span class="lineno">  489</span>&#160;      <a class="code" href="namespacecgroups.html#ab75e1e2d1be63eec907bf12306a7c8a7">kill</a>(child, <a class="code" href="3rdparty_2stout_2include_2stout_2windows_8hpp.html#a1c2b5693161bbc9d516ef5d16c7b54f5">SIGKILL</a>);</div>
-<div class="line"><a name="l00490"></a><span class="lineno">  490</span>&#160;      <span class="keywordflow">return</span> <a class="code" href="classError.html">Error</a>(<span class="stringliteral">&quot;Bad control data received&quot;</span>);</div>
-<div class="line"><a name="l00491"></a><span class="lineno">  491</span>&#160;    }</div>
-<div class="line"><a name="l00492"></a><span class="lineno">  492</span>&#160;</div>
-<div class="line"><a name="l00493"></a><span class="lineno">  493</span>&#160;    <a class="code" href="3rdparty_2stout_2include_2stout_2windows_8hpp.html#ab03ced250ed239bc3b50b669493997f9">pid_t</a> pid = ((<span class="keyword">struct </span>ucred*) CMSG_DATA(CMSG_FIRSTHDR(&amp;message)))-&gt;pid;</div>
-<div class="line"><a name="l00494"></a><span class="lineno">  494</span>&#160;</div>
-<div class="line"><a name="l00495"></a><span class="lineno">  495</span>&#160;    <span class="comment">// Need to `waitpid` on child process to avoid a zombie. Note that</span></div>
-<div class="line"><a name="l00496"></a><span class="lineno">  496</span>&#160;    <span class="comment">// it&#39;s expected that the child will terminate quickly hence</span></div>
-<div class="line"><a name="l00497"></a><span class="lineno">  497</span>&#160;    <span class="comment">// blocking here.</span></div>
-<div class="line"><a name="l00498"></a><span class="lineno">  498</span>&#160;    <span class="keywordtype">int</span> <a class="code" href="namespaceproc.html#a34396c6140a28f583dc13fee3c3c35d4">status</a>;</div>
-<div class="line"><a name="l00499"></a><span class="lineno">  499</span>&#160;    <span class="keywordflow">while</span> (<span class="keyword">true</span>) {</div>
-<div class="line"><a name="l00500"></a><span class="lineno">  500</span>&#160;      <span class="keywordflow">if</span> (<a class="code" href="namespaceos.html#a48c86262928f59c5c54d0cb0012e2aba">waitpid</a>(child, &amp;status, 0) == -1) {</div>
-<div class="line"><a name="l00501"></a><span class="lineno">  501</span>&#160;        <span class="keywordflow">if</span> (errno == EINTR) {</div>
-<div class="line"><a name="l00502"></a><span class="lineno">  502</span>&#160;          <span class="keywordflow">continue</span>;</div>
-<div class="line"><a name="l00503"></a><span class="lineno">  503</span>&#160;        } <span class="keywordflow">else</span> {</div>
-<div class="line"><a name="l00504"></a><span class="lineno">  504</span>&#160;          <span class="keywordflow">return</span> <a class="code" href="classErrnoError.html">ErrnoError</a>(<span class="stringliteral">&quot;Failed to `waitpid` on child&quot;</span>);</div>
-<div class="line"><a name="l00505"></a><span class="lineno">  505</span>&#160;        }</div>
-<div class="line"><a name="l00506"></a><span class="lineno">  506</span>&#160;      } <span class="keywordflow">else</span> <span class="keywordflow">if</span> (<a class="code" href="3rdparty_2stout_2include_2stout_2windows_8hpp.html#ae2b610235f988f4f3109f02a2f395727">WIFSTOPPED</a>(status)) {</div>
-<div class="line"><a name="l00507"></a><span class="lineno">  507</span>&#160;        <span class="keywordflow">continue</span>;</div>
-<div class="line"><a name="l00508"></a><span class="lineno">  508</span>&#160;      } <span class="keywordflow">else</span> {</div>
-<div class="line"><a name="l00509"></a><span class="lineno">  509</span>&#160;        <span class="keywordflow">break</span>;</div>
-<div class="line"><a name="l00510"></a><span class="lineno">  510</span>&#160;      }</div>
-<div class="line"><a name="l00511"></a><span class="lineno">  511</span>&#160;    }</div>
-<div class="line"><a name="l00512"></a><span class="lineno">  512</span>&#160;</div>
-<div class="line"><a name="l00513"></a><span class="lineno">  513</span>&#160;    CHECK(<a class="code" href="3rdparty_2stout_2include_2stout_2windows_8hpp.html#af9a4ddf9eee6c4a3bc9be070d59b7ccf">WIFEXITED</a>(status) || <a class="code" href="3rdparty_2stout_2include_2stout_2windows_8hpp.html#a6953e62fd0dec274a397678d31c344b4">WIFSIGNALED</a>(status))</div>
-<div class="line"><a name="l00514"></a><span class="lineno">  514</span>&#160;      &lt;&lt; <span class="stringliteral">&quot;Unexpected wait status &quot;</span> &lt;&lt; <a class="code" href="namespaceproc.html#a34396c6140a28f583dc13fee3c3c35d4">status</a>;</div>
-<div class="line"><a name="l00515"></a><span class="lineno">  515</span>&#160;</div>
-<div class="line"><a name="l00516"></a><span class="lineno">  516</span>&#160;    <span class="keywordflow">if</span> (!<a class="code" href="status__utils_8hpp.html#a9e2998a6c0ec36d796adcec49131a5db">WSUCCEEDED</a>(status)) {</div>
-<div class="line"><a name="l00517"></a><span class="lineno">  517</span>&#160;      <span class="keywordflow">return</span> <a class="code" href="classError.html">Error</a>(<span class="stringliteral">&quot;Failed to clone: &quot;</span> + <a class="code" href="status__utils_8hpp.html#aec7297ea295ff53f48cc0f25ce4a63f9">WSTRINGIFY</a>

<TRUNCATED>

Mime
View raw message