http://git-wip-us.apache.org/repos/asf/mesos-site/blob/2306ff3e/content/api/latest/c++/posix_2shell_8hpp_source.html ---------------------------------------------------------------------- diff --git a/content/api/latest/c++/posix_2shell_8hpp_source.html b/content/api/latest/c++/posix_2shell_8hpp_source.html index 1dcc8fa..83cf4d2 100644 --- a/content/api/latest/c++/posix_2shell_8hpp_source.html +++ b/content/api/latest/c++/posix_2shell_8hpp_source.html @@ -79,182 +79,188 @@ <div class="line"><a name="l00025"></a><span class="lineno"> 25</span> </div> <div class="line"><a name="l00026"></a><span class="lineno"> 26</span> <span class="preprocessor">#include <<a class="code" href="error_8hpp.html">stout/error.hpp</a>></span></div> <div class="line"><a name="l00027"></a><span class="lineno"> 27</span> <span class="preprocessor">#include <<a class="code" href="format_8hpp.html">stout/format.hpp</a>></span></div> -<div class="line"><a name="l00028"></a><span class="lineno"> 28</span> <span class="preprocessor">#include <<a class="code" href="try_8hpp.html">stout/try.hpp</a>></span></div> -<div class="line"><a name="l00029"></a><span class="lineno"> 29</span> </div> -<div class="line"><a name="l00030"></a><span class="lineno"> 30</span> <span class="preprocessor">#include <<a class="code" href="argv_8hpp.html">stout/os/raw/argv.hpp</a>></span></div> +<div class="line"><a name="l00028"></a><span class="lineno"> 28</span> <span class="preprocessor">#include <<a class="code" href="none_8hpp.html">stout/none.hpp</a>></span></div> +<div class="line"><a name="l00029"></a><span class="lineno"> 29</span> <span class="preprocessor">#include <<a class="code" href="option_8hpp.html">stout/option.hpp</a>></span></div> +<div class="line"><a name="l00030"></a><span class="lineno"> 30</span> <span class="preprocessor">#include <<a class="code" href="try_8hpp.html">stout/try.hpp</a>></span></div> <div class="line"><a name="l00031"></a><span class="lineno"> 31</span> </div> -<div class="line"><a name="l00032"></a><span class="lineno"> 32</span> <span class="keyword">namespace </span>os {</div> +<div class="line"><a name="l00032"></a><span class="lineno"> 32</span> <span class="preprocessor">#include <<a class="code" href="argv_8hpp.html">stout/os/raw/argv.hpp</a>></span></div> <div class="line"><a name="l00033"></a><span class="lineno"> 33</span> </div> -<div class="line"><a name="l00034"></a><span class="lineno"><a class="line" href="namespaceos_1_1Shell.html"> 34</a></span> <span class="keyword">namespace </span>Shell {</div> +<div class="line"><a name="l00034"></a><span class="lineno"> 34</span> <span class="keyword">namespace </span>os {</div> <div class="line"><a name="l00035"></a><span class="lineno"> 35</span> </div> -<div class="line"><a name="l00036"></a><span class="lineno"> 36</span> <span class="comment">// Canonical constants used as platform-dependent args to `exec`</span></div> -<div class="line"><a name="l00037"></a><span class="lineno"> 37</span> <span class="comment">// calls. `name` is the command name, `arg0` is the first argument</span></div> -<div class="line"><a name="l00038"></a><span class="lineno"> 38</span> <span class="comment">// received by the callee, usually the command name and `arg1` is the</span></div> -<div class="line"><a name="l00039"></a><span class="lineno"> 39</span> <span class="comment">// second command argument received by the callee.</span></div> -<div class="line"><a name="l00040"></a><span class="lineno"> 40</span> </div> -<div class="line"><a name="l00041"></a><span class="lineno"><a class="line" href="namespaceos_1_1Shell.html#acfe16ef2b1146ad49a8651c0a457ce46"> 41</a></span> constexpr <span class="keyword">const</span> <span class="keywordtype">char</span>* <a class="code" href="namespaceos_1_1Shell.html#acfe16ef2b1146ad49a8651c0a457ce46">name</a> = <span class="stringliteral">"sh"</span>;</div> -<div class="line"><a name="l00042"></a><span class="lineno"><a class="line" href="namespaceos_1_1Shell.html#adeacb41dacfa03ad5ceebd9a53582997"> 42</a></span> constexpr <span class="keyword">const</span> <span class="keywordtype">char</span>* <a class="code" href="namespaceos_1_1Shell.html#adeacb41dacfa03ad5ceebd9a53582997">arg0</a> = <span class="stringliteral">"sh"</span>;</div> -<div class="line"><a name="l00043"></a><span class="lineno"><a class="line" href="namespaceos_1_1Shell.html#a44f50f66f2a231de974b53c9f4384ba5"> 43</a></span> constexpr <span class="keyword">const</span> <span class="keywordtype">char</span>* <a class="code" href="namespaceos_1_1Shell.html#a44f50f66f2a231de974b53c9f4384ba5">arg1</a> = <span class="stringliteral">"-c"</span>;</div> -<div class="line"><a name="l00044"></a><span class="lineno"> 44</span> </div> -<div class="line"><a name="l00045"></a><span class="lineno"> 45</span> } <span class="comment">// namespace Shell {</span></div> +<div class="line"><a name="l00036"></a><span class="lineno"><a class="line" href="namespaceos_1_1Shell.html"> 36</a></span> <span class="keyword">namespace </span>Shell {</div> +<div class="line"><a name="l00037"></a><span class="lineno"> 37</span> </div> +<div class="line"><a name="l00038"></a><span class="lineno"> 38</span> <span class="comment">// Canonical constants used as platform-dependent args to `exec`</span></div> +<div class="line"><a name="l00039"></a><span class="lineno"> 39</span> <span class="comment">// calls. `name` is the command name, `arg0` is the first argument</span></div> +<div class="line"><a name="l00040"></a><span class="lineno"> 40</span> <span class="comment">// received by the callee, usually the command name and `arg1` is the</span></div> +<div class="line"><a name="l00041"></a><span class="lineno"> 41</span> <span class="comment">// second command argument received by the callee.</span></div> +<div class="line"><a name="l00042"></a><span class="lineno"> 42</span> </div> +<div class="line"><a name="l00043"></a><span class="lineno"><a class="line" href="namespaceos_1_1Shell.html#acfe16ef2b1146ad49a8651c0a457ce46"> 43</a></span> constexpr <span class="keyword">const</span> <span class="keywordtype">char</span>* <a class="code" href="namespaceos_1_1Shell.html#acfe16ef2b1146ad49a8651c0a457ce46">name</a> = <span class="stringliteral">"sh"</span>;</div> +<div class="line"><a name="l00044"></a><span class="lineno"><a class="line" href="namespaceos_1_1Shell.html#adeacb41dacfa03ad5ceebd9a53582997"> 44</a></span> constexpr <span class="keyword">const</span> <span class="keywordtype">char</span>* <a class="code" href="namespaceos_1_1Shell.html#adeacb41dacfa03ad5ceebd9a53582997">arg0</a> = <span class="stringliteral">"sh"</span>;</div> +<div class="line"><a name="l00045"></a><span class="lineno"><a class="line" href="namespaceos_1_1Shell.html#a44f50f66f2a231de974b53c9f4384ba5"> 45</a></span> constexpr <span class="keyword">const</span> <span class="keywordtype">char</span>* <a class="code" href="namespaceos_1_1Shell.html#a44f50f66f2a231de974b53c9f4384ba5">arg1</a> = <span class="stringliteral">"-c"</span>;</div> <div class="line"><a name="l00046"></a><span class="lineno"> 46</span> </div> -<div class="line"><a name="l00070"></a><span class="lineno"> 70</span> <span class="keyword">template</span> <<span class="keyword">typename</span>... T></div> -<div class="line"><a name="l00071"></a><span class="lineno"><a class="line" href="namespaceos.html#a0d86320d7799ea761599bc356c02a4fa"> 71</a></span> <a class="code" href="classTry.html">Try<std::string></a> <a class="code" href="namespaceos.html#a0d86320d7799ea761599bc356c02a4fa">shell</a>(<span class="keyword">const</span> std::string& fmt, <span class="keyword">const</span> T&... t)</div> -<div class="line"><a name="l00072"></a><span class="lineno"> 72</span> {</div> -<div class="line"><a name="l00073"></a><span class="lineno"> 73</span>  <span class="keyword">const</span> <a class="code" href="classTry.html">Try<std::string></a> command = <a class="code" href="namespacestrings_1_1internal.html#a870e2db270d980f83de20525ec414d2a">strings::internal::format</a>(fmt, t...);</div> -<div class="line"><a name="l00074"></a><span class="lineno"> 74</span>  <span class="keywordflow">if</span> (command.<a class="code" href="classTry.html#a0b98f95163b8a38daafd1651b043a276">isError</a>()) {</div> -<div class="line"><a name="l00075"></a><span class="lineno"> 75</span>  <span class="keywordflow">return</span> <a class="code" href="classError.html">Error</a>(command.<a class="code" href="classTry.html#aec4a11ddd3c036e889d90b7eb6258ba7">error</a>());</div> -<div class="line"><a name="l00076"></a><span class="lineno"> 76</span>  }</div> -<div class="line"><a name="l00077"></a><span class="lineno"> 77</span> </div> -<div class="line"><a name="l00078"></a><span class="lineno"> 78</span>  FILE* <a class="code" href="namespacemesos_1_1uri.html#a0a3b30c1eb427c4053aaef120b1f453c">file</a>;</div> -<div class="line"><a name="l00079"></a><span class="lineno"> 79</span>  std::ostringstream stdout;</div> -<div class="line"><a name="l00080"></a><span class="lineno"> 80</span> </div> -<div class="line"><a name="l00081"></a><span class="lineno"> 81</span>  <span class="keywordflow">if</span> ((file = popen(command->c_str(), <span class="stringliteral">"r"</span>)) == <span class="keyword">nullptr</span>) {</div> -<div class="line"><a name="l00082"></a><span class="lineno"> 82</span>  <span class="keywordflow">return</span> <a class="code" href="classError.html">Error</a>(<span class="stringliteral">"Failed to run '"</span> + command.<a class="code" href="classTry.html#a8bc7f43e75a47111ea18e9c83b007be5">get</a>() + <span class="stringliteral">"'"</span>);</div> -<div class="line"><a name="l00083"></a><span class="lineno"> 83</span>  }</div> -<div class="line"><a name="l00084"></a><span class="lineno"> 84</span> </div> -<div class="line"><a name="l00085"></a><span class="lineno"> 85</span>  <span class="keywordtype">char</span> line[1024];</div> -<div class="line"><a name="l00086"></a><span class="lineno"> 86</span>  <span class="comment">// NOTE(vinod): Ideally the if and while loops should be interchanged. But</span></div> -<div class="line"><a name="l00087"></a><span class="lineno"> 87</span>  <span class="comment">// we get a broken pipe error if we don't read the output and simply close.</span></div> -<div class="line"><a name="l00088"></a><span class="lineno"> 88</span>  <span class="keywordflow">while</span> (fgets(line, <span class="keyword">sizeof</span>(line), file) != <span class="keyword">nullptr</span>) {</div> -<div class="line"><a name="l00089"></a><span class="lineno"> 89</span>  stdout << line;</div> -<div class="line"><a name="l00090"></a><span class="lineno"> 90</span>  }</div> -<div class="line"><a name="l00091"></a><span class="lineno"> 91</span> </div> -<div class="line"><a name="l00092"></a><span class="lineno"> 92</span>  <span class="keywordflow">if</span> (ferror(file) != 0) {</div> -<div class="line"><a name="l00093"></a><span class="lineno"> 93</span>  pclose(file); <span class="comment">// Ignoring result since we already have an error.</span></div> -<div class="line"><a name="l00094"></a><span class="lineno"> 94</span>  <span class="keywordflow">return</span> <a class="code" href="classError.html">Error</a>(<span class="stringliteral">"Error reading output of '"</span> + command.<a class="code" href="classTry.html#a8bc7f43e75a47111ea18e9c83b007be5">get</a>() + <span class="stringliteral">"'"</span>);</div> -<div class="line"><a name="l00095"></a><span class="lineno"> 95</span>  }</div> -<div class="line"><a name="l00096"></a><span class="lineno"> 96</span> </div> -<div class="line"><a name="l00097"></a><span class="lineno"> 97</span>  <span class="keywordtype">int</span> <a class="code" href="namespaceproc.html#a34396c6140a28f583dc13fee3c3c35d4">status</a>;</div> -<div class="line"><a name="l00098"></a><span class="lineno"> 98</span>  <span class="keywordflow">if</span> ((status = pclose(file)) == -1) {</div> -<div class="line"><a name="l00099"></a><span class="lineno"> 99</span>  <span class="keywordflow">return</span> <a class="code" href="classError.html">Error</a>(<span class="stringliteral">"Failed to get status of '"</span> + command.<a class="code" href="classTry.html#a8bc7f43e75a47111ea18e9c83b007be5">get</a>() + <span class="stringliteral">"'"</span>);</div> -<div class="line"><a name="l00100"></a><span class="lineno"> 100</span>  }</div> -<div class="line"><a name="l00101"></a><span class="lineno"> 101</span> </div> -<div class="line"><a name="l00102"></a><span class="lineno"> 102</span>  <span class="keywordflow">if</span> (<a class="code" href="3rdparty_2stout_2include_2stout_2windows_8hpp.html#a6953e62fd0dec274a397678d31c344b4">WIFSIGNALED</a>(status)) {</div> -<div class="line"><a name="l00103"></a><span class="lineno"> 103</span>  <span class="keywordflow">return</span> <a class="code" href="classError.html">Error</a>(</div> -<div class="line"><a name="l00104"></a><span class="lineno"> 104</span>  <span class="stringliteral">"Running '"</span> + command.<a class="code" href="classTry.html#a8bc7f43e75a47111ea18e9c83b007be5">get</a>() + <span class="stringliteral">"' was interrupted by signal '"</span> +</div> -<div class="line"><a name="l00105"></a><span class="lineno"> 105</span>  <a class="code" href="3rdparty_2stout_2include_2stout_2windows_8hpp.html#a3858fc90369448097210e69437ca7c66">strsignal</a>(<a class="code" href="3rdparty_2stout_2include_2stout_2windows_8hpp.html#aeba4d421572a9d681c73c347f24ad348">WTERMSIG</a>(status)) + <span class="stringliteral">"'"</span>);</div> -<div class="line"><a name="l00106"></a><span class="lineno"> 106</span>  } <span class="keywordflow">else</span> <span class="keywordflow">if</span> ((<a class="code" href="3rdparty_2stout_2include_2stout_2windows_8hpp.html#ae0c8840076dd63d5e2367fff4f7f46f3">WEXITSTATUS</a>(status) != EXIT_SUCCESS)) {</div> -<div class="line"><a name="l00107"></a><span class="lineno"> 107</span>  LOG(ERROR) << <span class="stringliteral">"Command '"</span> << command.<a class="code" href="classTry.html#a8bc7f43e75a47111ea18e9c83b007be5">get</a>()</div> -<div class="line"><a name="l00108"></a><span class="lineno"> 108</span>  << <span class="stringliteral">"' failed; this is the output:\n"</span> << stdout.str();</div> -<div class="line"><a name="l00109"></a><span class="lineno"> 109</span>  <span class="keywordflow">return</span> <a class="code" href="classError.html">Error</a>(</div> -<div class="line"><a name="l00110"></a><span class="lineno"> 110</span>  <span class="stringliteral">"Failed to execute '"</span> + command.<a class="code" href="classTry.html#a8bc7f43e75a47111ea18e9c83b007be5">get</a>() + <span class="stringliteral">"'; the command was either "</span></div> -<div class="line"><a name="l00111"></a><span class="lineno"> 111</span>  <span class="stringliteral">"not found or exited with a non-zero exit status: "</span> +</div> -<div class="line"><a name="l00112"></a><span class="lineno"> 112</span>  <a class="code" href="namespacens.html#a28116b46e6543597a11733424cd1aa20">stringify</a>(<a class="code" href="3rdparty_2stout_2include_2stout_2windows_8hpp.html#ae0c8840076dd63d5e2367fff4f7f46f3">WEXITSTATUS</a>(status)));</div> -<div class="line"><a name="l00113"></a><span class="lineno"> 113</span>  }</div> -<div class="line"><a name="l00114"></a><span class="lineno"> 114</span> </div> -<div class="line"><a name="l00115"></a><span class="lineno"> 115</span>  <span class="keywordflow">return</span> stdout.str();</div> -<div class="line"><a name="l00116"></a><span class="lineno"> 116</span> }</div> -<div class="line"><a name="l00117"></a><span class="lineno"> 117</span> </div> -<div class="line"><a name="l00118"></a><span class="lineno"> 118</span> </div> -<div class="line"><a name="l00119"></a><span class="lineno"> 119</span> <span class="comment">// Executes a command by calling "/bin/sh -c <command>", and returns</span></div> -<div class="line"><a name="l00120"></a><span class="lineno"> 120</span> <span class="comment">// after the command has been completed. Returns 0 if succeeds, and</span></div> -<div class="line"><a name="l00121"></a><span class="lineno"> 121</span> <span class="comment">// return -1 on error (e.g., fork/exec/waitpid failed). This function</span></div> -<div class="line"><a name="l00122"></a><span class="lineno"> 122</span> <span class="comment">// is async signal safe. We return int instead of returning a Try</span></div> -<div class="line"><a name="l00123"></a><span class="lineno"> 123</span> <span class="comment">// because Try involves 'new', which is not async signal safe.</span></div> -<div class="line"><a name="l00124"></a><span class="lineno"> 124</span> <span class="comment">//</span></div> -<div class="line"><a name="l00125"></a><span class="lineno"> 125</span> <span class="comment">// Note: Be cautious about shell injection</span></div> -<div class="line"><a name="l00126"></a><span class="lineno"> 126</span> <span class="comment">// (https://en.wikipedia.org/wiki/Code_injection#Shell_injection)</span></div> -<div class="line"><a name="l00127"></a><span class="lineno"> 127</span> <span class="comment">// when using this method and use proper validation and sanitization</span></div> -<div class="line"><a name="l00128"></a><span class="lineno"> 128</span> <span class="comment">// on the `command`. For this reason in general `os::spawn` is</span></div> -<div class="line"><a name="l00129"></a><span class="lineno"> 129</span> <span class="comment">// preferred if a shell is not required.</span></div> -<div class="line"><a name="l00130"></a><span class="lineno"><a class="line" href="namespaceos.html#a3491ce5d4a57fcac5ca2e3ca40abe176"> 130</a></span> <span class="keyword">inline</span> <span class="keywordtype">int</span> <a class="code" href="namespaceos.html#a3491ce5d4a57fcac5ca2e3ca40abe176">system</a>(<span class="keyword">const</span> std::string& command)</div> -<div class="line"><a name="l00131"></a><span class="lineno"> 131</span> {</div> -<div class="line"><a name="l00132"></a><span class="lineno"> 132</span>  <a class="code" href="3rdparty_2stout_2include_2stout_2windows_8hpp.html#ab03ced250ed239bc3b50b669493997f9">pid_t</a> pid = ::fork();</div> -<div class="line"><a name="l00133"></a><span class="lineno"> 133</span> </div> -<div class="line"><a name="l00134"></a><span class="lineno"> 134</span>  <span class="keywordflow">if</span> (pid == -1) {</div> -<div class="line"><a name="l00135"></a><span class="lineno"> 135</span>  <span class="keywordflow">return</span> -1;</div> -<div class="line"><a name="l00136"></a><span class="lineno"> 136</span>  } <span class="keywordflow">else</span> <span class="keywordflow">if</span> (pid == 0) {</div> -<div class="line"><a name="l00137"></a><span class="lineno"> 137</span>  <span class="comment">// In child process.</span></div> -<div class="line"><a name="l00138"></a><span class="lineno"> 138</span>  <a class="code" href="namespaceos.html#a4b727e301623549c37cdfcd8c553a2c7">::execlp</a>(</div> -<div class="line"><a name="l00139"></a><span class="lineno"> 139</span>  <a class="code" href="namespaceos_1_1Shell.html#acfe16ef2b1146ad49a8651c0a457ce46">Shell::name</a>, <a class="code" href="namespaceos_1_1Shell.html#adeacb41dacfa03ad5ceebd9a53582997">Shell::arg0</a>, <a class="code" href="namespaceos_1_1Shell.html#a44f50f66f2a231de974b53c9f4384ba5">Shell::arg1</a>, command.c_str(), (<span class="keywordtype">char</span>*)<span class="keyword">nullptr</span>);</div> -<div class="line"><a name="l00140"></a><span class="lineno"> 140</span>  ::exit(127);</div> -<div class="line"><a name="l00141"></a><span class="lineno"> 141</span>  } <span class="keywordflow">else</span> {</div> -<div class="line"><a name="l00142"></a><span class="lineno"> 142</span>  <span class="comment">// In parent process.</span></div> -<div class="line"><a name="l00143"></a><span class="lineno"> 143</span>  <span class="keywordtype">int</span> <a class="code" href="namespaceproc.html#a34396c6140a28f583dc13fee3c3c35d4">status</a>;</div> -<div class="line"><a name="l00144"></a><span class="lineno"> 144</span>  <span class="keywordflow">while</span> (::<a class="code" href="namespaceos.html#a48c86262928f59c5c54d0cb0012e2aba">waitpid</a>(pid, &status, 0) == -1) {</div> -<div class="line"><a name="l00145"></a><span class="lineno"> 145</span>  <span class="keywordflow">if</span> (errno != EINTR) {</div> -<div class="line"><a name="l00146"></a><span class="lineno"> 146</span>  <span class="keywordflow">return</span> -1;</div> -<div class="line"><a name="l00147"></a><span class="lineno"> 147</span>  }</div> -<div class="line"><a name="l00148"></a><span class="lineno"> 148</span>  }</div> -<div class="line"><a name="l00149"></a><span class="lineno"> 149</span> </div> -<div class="line"><a name="l00150"></a><span class="lineno"> 150</span>  <span class="keywordflow">return</span> <a class="code" href="namespaceproc.html#a34396c6140a28f583dc13fee3c3c35d4">status</a>;</div> -<div class="line"><a name="l00151"></a><span class="lineno"> 151</span>  }</div> -<div class="line"><a name="l00152"></a><span class="lineno"> 152</span> }</div> -<div class="line"><a name="l00153"></a><span class="lineno"> 153</span> </div> -<div class="line"><a name="l00154"></a><span class="lineno"> 154</span> <span class="comment">// Executes a command by calling "<command> <arguments...>", and</span></div> -<div class="line"><a name="l00155"></a><span class="lineno"> 155</span> <span class="comment">// returns after the command has been completed. Returns 0 if</span></div> -<div class="line"><a name="l00156"></a><span class="lineno"> 156</span> <span class="comment">// succeeds, and -1 on error (e.g., fork/exec/waitpid failed). This</span></div> -<div class="line"><a name="l00157"></a><span class="lineno"> 157</span> <span class="comment">// function is async signal safe. We return int instead of returning a</span></div> -<div class="line"><a name="l00158"></a><span class="lineno"> 158</span> <span class="comment">// Try because Try involves 'new', which is not async signal safe.</span></div> -<div class="line"><a name="l00159"></a><span class="lineno"><a class="line" href="namespaceos.html#a59cf3d26475f4001630e0e362e7a3ff7"> 159</a></span> <span class="keyword">inline</span> <span class="keywordtype">int</span> <a class="code" href="namespaceos.html#a59cf3d26475f4001630e0e362e7a3ff7">spawn</a>(</div> -<div class="line"><a name="l00160"></a><span class="lineno"> 160</span>  <span class="keyword">const</span> std::string& command,</div> -<div class="line"><a name="l00161"></a><span class="lineno"> 161</span>  <span class="keyword">const</span> std::vector<std::string>& arguments)</div> -<div class="line"><a name="l00162"></a><span class="lineno"> 162</span> {</div> -<div class="line"><a name="l00163"></a><span class="lineno"> 163</span>  <a class="code" href="3rdparty_2stout_2include_2stout_2windows_8hpp.html#ab03ced250ed239bc3b50b669493997f9">pid_t</a> pid = ::fork();</div> -<div class="line"><a name="l00164"></a><span class="lineno"> 164</span> </div> -<div class="line"><a name="l00165"></a><span class="lineno"> 165</span>  <span class="keywordflow">if</span> (pid == -1) {</div> -<div class="line"><a name="l00166"></a><span class="lineno"> 166</span>  <span class="keywordflow">return</span> -1;</div> -<div class="line"><a name="l00167"></a><span class="lineno"> 167</span>  } <span class="keywordflow">else</span> <span class="keywordflow">if</span> (pid == 0) {</div> -<div class="line"><a name="l00168"></a><span class="lineno"> 168</span>  <span class="comment">// In child process.</span></div> -<div class="line"><a name="l00169"></a><span class="lineno"> 169</span>  <a class="code" href="namespaceos.html#a0b80877b34088be8d5ba3eb9b0567ed7">::execvp</a>(command.c_str(), <a class="code" href="classos_1_1raw_1_1Argv.html">os::raw::Argv</a>(arguments));</div> -<div class="line"><a name="l00170"></a><span class="lineno"> 170</span>  ::exit(127);</div> -<div class="line"><a name="l00171"></a><span class="lineno"> 171</span>  } <span class="keywordflow">else</span> {</div> -<div class="line"><a name="l00172"></a><span class="lineno"> 172</span>  <span class="comment">// In parent process.</span></div> -<div class="line"><a name="l00173"></a><span class="lineno"> 173</span>  <span class="keywordtype">int</span> <a class="code" href="namespaceproc.html#a34396c6140a28f583dc13fee3c3c35d4">status</a>;</div> -<div class="line"><a name="l00174"></a><span class="lineno"> 174</span>  <span class="keywordflow">while</span> (::<a class="code" href="namespaceos.html#a48c86262928f59c5c54d0cb0012e2aba">waitpid</a>(pid, &status, 0) == -1) {</div> -<div class="line"><a name="l00175"></a><span class="lineno"> 175</span>  <span class="keywordflow">if</span> (errno != EINTR) {</div> -<div class="line"><a name="l00176"></a><span class="lineno"> 176</span>  <span class="keywordflow">return</span> -1;</div> -<div class="line"><a name="l00177"></a><span class="lineno"> 177</span>  }</div> -<div class="line"><a name="l00178"></a><span class="lineno"> 178</span>  }</div> -<div class="line"><a name="l00179"></a><span class="lineno"> 179</span> </div> -<div class="line"><a name="l00180"></a><span class="lineno"> 180</span>  <span class="keywordflow">return</span> <a class="code" href="namespaceproc.html#a34396c6140a28f583dc13fee3c3c35d4">status</a>;</div> -<div class="line"><a name="l00181"></a><span class="lineno"> 181</span>  }</div> -<div class="line"><a name="l00182"></a><span class="lineno"> 182</span> }</div> -<div class="line"><a name="l00183"></a><span class="lineno"> 183</span> </div> -<div class="line"><a name="l00184"></a><span class="lineno"> 184</span> </div> -<div class="line"><a name="l00185"></a><span class="lineno"> 185</span> <span class="keyword">template</span><<span class="keyword">typename</span>... T></div> -<div class="line"><a name="l00186"></a><span class="lineno"><a class="line" href="namespaceos.html#a4b727e301623549c37cdfcd8c553a2c7"> 186</a></span> <span class="keyword">inline</span> <span class="keywordtype">int</span> <a class="code" href="namespaceos.html#a4b727e301623549c37cdfcd8c553a2c7">execlp</a>(<span class="keyword">const</span> <span class="keywordtype">char</span>* <a class="code" href="namespacemesos_1_1uri.html#a0a3b30c1eb427c4053aaef120b1f453c">file</a>, T... t)</div> -<div class="line"><a name="l00187"></a><span class="lineno"> 187</span> {</div> -<div class="line"><a name="l00188"></a><span class="lineno"> 188</span>  <a class="code" href="namespaceos.html#a4b727e301623549c37cdfcd8c553a2c7">return ::execlp</a>(file, t...);</div> -<div class="line"><a name="l00189"></a><span class="lineno"> 189</span> }</div> -<div class="line"><a name="l00190"></a><span class="lineno"> 190</span> </div> -<div class="line"><a name="l00191"></a><span class="lineno"> 191</span> </div> -<div class="line"><a name="l00192"></a><span class="lineno"><a class="line" href="namespaceos.html#a0b80877b34088be8d5ba3eb9b0567ed7"> 192</a></span> <span class="keyword">inline</span> <span class="keywordtype">int</span> <a class="code" href="namespaceos.html#a0b80877b34088be8d5ba3eb9b0567ed7">execvp</a>(<span class="keyword">const</span> <span class="keywordtype">char</span>* <a class="code" href="namespacemesos_1_1uri.html#a0a3b30c1eb427c4053aaef120b1f453c">file</a>, <span class="keywordtype">char</span>* <span class="keyword">const</span> argv[])</div> -<div class="line"><a name="l00193"></a><span class="lineno"> 193</span> {</div> -<div class="line"><a name="l00194"></a><span class="lineno"> 194</span>  <a class="code" href="namespaceos.html#a0b80877b34088be8d5ba3eb9b0567ed7">return ::execvp</a>(file, argv);</div> -<div class="line"><a name="l00195"></a><span class="lineno"> 195</span> }</div> -<div class="line"><a name="l00196"></a><span class="lineno"> 196</span> </div> -<div class="line"><a name="l00197"></a><span class="lineno"> 197</span> } <span class="comment">// namespace os {</span></div> -<div class="line"><a name="l00198"></a><span class="lineno"> 198</span> </div> -<div class="line"><a name="l00199"></a><span class="lineno"> 199</span> <span class="preprocessor">#endif // __STOUT_OS_POSIX_SHELL_HPP__</span></div> -<div class="ttc" id="namespaceos_1_1Shell_html_a44f50f66f2a231de974b53c9f4384ba5"><div class="ttname"><a href="namespaceos_1_1Shell.html#a44f50f66f2a231de974b53c9f4384ba5">os::Shell::arg1</a></div><div class="ttdeci">constexpr const char * arg1</div><div class="ttdef"><b>Definition:</b> shell.hpp:43</div></div> +<div class="line"><a name="l00047"></a><span class="lineno"> 47</span> } <span class="comment">// namespace Shell {</span></div> +<div class="line"><a name="l00048"></a><span class="lineno"> 48</span> </div> +<div class="line"><a name="l00072"></a><span class="lineno"> 72</span> <span class="keyword">template</span> <<span class="keyword">typename</span>... T></div> +<div class="line"><a name="l00073"></a><span class="lineno"><a class="line" href="namespaceos.html#a0d86320d7799ea761599bc356c02a4fa"> 73</a></span> <a class="code" href="classTry.html">Try<std::string></a> <a class="code" href="namespaceos.html#a0d86320d7799ea761599bc356c02a4fa">shell</a>(<span class="keyword">const</span> std::string& fmt, <span class="keyword">const</span> T&... t)</div> +<div class="line"><a name="l00074"></a><span class="lineno"> 74</span> {</div> +<div class="line"><a name="l00075"></a><span class="lineno"> 75</span>  <span class="keyword">const</span> <a class="code" href="classTry.html">Try<std::string></a> command = <a class="code" href="namespacestrings_1_1internal.html#a870e2db270d980f83de20525ec414d2a">strings::internal::format</a>(fmt, t...);</div> +<div class="line"><a name="l00076"></a><span class="lineno"> 76</span>  <span class="keywordflow">if</span> (command.<a class="code" href="classTry.html#a0b98f95163b8a38daafd1651b043a276">isError</a>()) {</div> +<div class="line"><a name="l00077"></a><span class="lineno"> 77</span>  <span class="keywordflow">return</span> <a class="code" href="classError.html">Error</a>(command.<a class="code" href="classTry.html#aec4a11ddd3c036e889d90b7eb6258ba7">error</a>());</div> +<div class="line"><a name="l00078"></a><span class="lineno"> 78</span>  }</div> +<div class="line"><a name="l00079"></a><span class="lineno"> 79</span> </div> +<div class="line"><a name="l00080"></a><span class="lineno"> 80</span>  FILE* <a class="code" href="namespacemesos_1_1uri.html#a0a3b30c1eb427c4053aaef120b1f453c">file</a>;</div> +<div class="line"><a name="l00081"></a><span class="lineno"> 81</span>  std::ostringstream stdout;</div> +<div class="line"><a name="l00082"></a><span class="lineno"> 82</span> </div> +<div class="line"><a name="l00083"></a><span class="lineno"> 83</span>  <span class="keywordflow">if</span> ((file = popen(command->c_str(), <span class="stringliteral">"r"</span>)) == <span class="keyword">nullptr</span>) {</div> +<div class="line"><a name="l00084"></a><span class="lineno"> 84</span>  <span class="keywordflow">return</span> <a class="code" href="classError.html">Error</a>(<span class="stringliteral">"Failed to run '"</span> + command.<a class="code" href="classTry.html#a8bc7f43e75a47111ea18e9c83b007be5">get</a>() + <span class="stringliteral">"'"</span>);</div> +<div class="line"><a name="l00085"></a><span class="lineno"> 85</span>  }</div> +<div class="line"><a name="l00086"></a><span class="lineno"> 86</span> </div> +<div class="line"><a name="l00087"></a><span class="lineno"> 87</span>  <span class="keywordtype">char</span> line[1024];</div> +<div class="line"><a name="l00088"></a><span class="lineno"> 88</span>  <span class="comment">// NOTE(vinod): Ideally the if and while loops should be interchanged. But</span></div> +<div class="line"><a name="l00089"></a><span class="lineno"> 89</span>  <span class="comment">// we get a broken pipe error if we don't read the output and simply close.</span></div> +<div class="line"><a name="l00090"></a><span class="lineno"> 90</span>  <span class="keywordflow">while</span> (fgets(line, <span class="keyword">sizeof</span>(line), file) != <span class="keyword">nullptr</span>) {</div> +<div class="line"><a name="l00091"></a><span class="lineno"> 91</span>  stdout << line;</div> +<div class="line"><a name="l00092"></a><span class="lineno"> 92</span>  }</div> +<div class="line"><a name="l00093"></a><span class="lineno"> 93</span> </div> +<div class="line"><a name="l00094"></a><span class="lineno"> 94</span>  <span class="keywordflow">if</span> (ferror(file) != 0) {</div> +<div class="line"><a name="l00095"></a><span class="lineno"> 95</span>  pclose(file); <span class="comment">// Ignoring result since we already have an error.</span></div> +<div class="line"><a name="l00096"></a><span class="lineno"> 96</span>  <span class="keywordflow">return</span> <a class="code" href="classError.html">Error</a>(<span class="stringliteral">"Error reading output of '"</span> + command.<a class="code" href="classTry.html#a8bc7f43e75a47111ea18e9c83b007be5">get</a>() + <span class="stringliteral">"'"</span>);</div> +<div class="line"><a name="l00097"></a><span class="lineno"> 97</span>  }</div> +<div class="line"><a name="l00098"></a><span class="lineno"> 98</span> </div> +<div class="line"><a name="l00099"></a><span class="lineno"> 99</span>  <span class="keywordtype">int</span> <a class="code" href="namespaceproc.html#a34396c6140a28f583dc13fee3c3c35d4">status</a>;</div> +<div class="line"><a name="l00100"></a><span class="lineno"> 100</span>  <span class="keywordflow">if</span> ((status = pclose(file)) == -1) {</div> +<div class="line"><a name="l00101"></a><span class="lineno"> 101</span>  <span class="keywordflow">return</span> <a class="code" href="classError.html">Error</a>(<span class="stringliteral">"Failed to get status of '"</span> + command.<a class="code" href="classTry.html#a8bc7f43e75a47111ea18e9c83b007be5">get</a>() + <span class="stringliteral">"'"</span>);</div> +<div class="line"><a name="l00102"></a><span class="lineno"> 102</span>  }</div> +<div class="line"><a name="l00103"></a><span class="lineno"> 103</span> </div> +<div class="line"><a name="l00104"></a><span class="lineno"> 104</span>  <span class="keywordflow">if</span> (<a class="code" href="3rdparty_2stout_2include_2stout_2windows_8hpp.html#a6953e62fd0dec274a397678d31c344b4">WIFSIGNALED</a>(status)) {</div> +<div class="line"><a name="l00105"></a><span class="lineno"> 105</span>  <span class="keywordflow">return</span> <a class="code" href="classError.html">Error</a>(</div> +<div class="line"><a name="l00106"></a><span class="lineno"> 106</span>  <span class="stringliteral">"Running '"</span> + command.<a class="code" href="classTry.html#a8bc7f43e75a47111ea18e9c83b007be5">get</a>() + <span class="stringliteral">"' was interrupted by signal '"</span> +</div> +<div class="line"><a name="l00107"></a><span class="lineno"> 107</span>  <a class="code" href="3rdparty_2stout_2include_2stout_2windows_8hpp.html#a3858fc90369448097210e69437ca7c66">strsignal</a>(WTERMSIG(status)) + <span class="stringliteral">"'"</span>);</div> +<div class="line"><a name="l00108"></a><span class="lineno"> 108</span>  } <span class="keywordflow">else</span> <span class="keywordflow">if</span> ((<a class="code" href="3rdparty_2stout_2include_2stout_2windows_8hpp.html#ae0c8840076dd63d5e2367fff4f7f46f3">WEXITSTATUS</a>(status) != EXIT_SUCCESS)) {</div> +<div class="line"><a name="l00109"></a><span class="lineno"> 109</span>  LOG(ERROR) << <span class="stringliteral">"Command '"</span> << command.<a class="code" href="classTry.html#a8bc7f43e75a47111ea18e9c83b007be5">get</a>()</div> +<div class="line"><a name="l00110"></a><span class="lineno"> 110</span>  << <span class="stringliteral">"' failed; this is the output:\n"</span> << stdout.str();</div> +<div class="line"><a name="l00111"></a><span class="lineno"> 111</span>  <span class="keywordflow">return</span> <a class="code" href="classError.html">Error</a>(</div> +<div class="line"><a name="l00112"></a><span class="lineno"> 112</span>  <span class="stringliteral">"Failed to execute '"</span> + command.<a class="code" href="classTry.html#a8bc7f43e75a47111ea18e9c83b007be5">get</a>() + <span class="stringliteral">"'; the command was either "</span></div> +<div class="line"><a name="l00113"></a><span class="lineno"> 113</span>  <span class="stringliteral">"not found or exited with a non-zero exit status: "</span> +</div> +<div class="line"><a name="l00114"></a><span class="lineno"> 114</span>  <a class="code" href="namespacens.html#a28116b46e6543597a11733424cd1aa20">stringify</a>(<a class="code" href="3rdparty_2stout_2include_2stout_2windows_8hpp.html#ae0c8840076dd63d5e2367fff4f7f46f3">WEXITSTATUS</a>(status)));</div> +<div class="line"><a name="l00115"></a><span class="lineno"> 115</span>  }</div> +<div class="line"><a name="l00116"></a><span class="lineno"> 116</span> </div> +<div class="line"><a name="l00117"></a><span class="lineno"> 117</span>  <span class="keywordflow">return</span> stdout.str();</div> +<div class="line"><a name="l00118"></a><span class="lineno"> 118</span> }</div> +<div class="line"><a name="l00119"></a><span class="lineno"> 119</span> </div> +<div class="line"><a name="l00120"></a><span class="lineno"> 120</span> </div> +<div class="line"><a name="l00121"></a><span class="lineno"> 121</span> <span class="comment">// Executes a command by calling "/bin/sh -c <command>", and returns</span></div> +<div class="line"><a name="l00122"></a><span class="lineno"> 122</span> <span class="comment">// after the command has been completed. Returns the exit code on success</span></div> +<div class="line"><a name="l00123"></a><span class="lineno"> 123</span> <span class="comment">// and `None` on error (e.g., fork/exec/waitpid failed). This function</span></div> +<div class="line"><a name="l00124"></a><span class="lineno"> 124</span> <span class="comment">// is async signal safe. We return an `Option<int>` instead of a `Try<int>`,</span></div> +<div class="line"><a name="l00125"></a><span class="lineno"> 125</span> <span class="comment">// because although `Try` does not dynamically allocate, `Error` uses</span></div> +<div class="line"><a name="l00126"></a><span class="lineno"> 126</span> <span class="comment">// `std::string`, which is not async signal safe.</span></div> +<div class="line"><a name="l00127"></a><span class="lineno"> 127</span> <span class="comment">//</span></div> +<div class="line"><a name="l00128"></a><span class="lineno"> 128</span> <span class="comment">// Note: Be cautious about shell injection</span></div> +<div class="line"><a name="l00129"></a><span class="lineno"> 129</span> <span class="comment">// (https://en.wikipedia.org/wiki/Code_injection#Shell_injection)</span></div> +<div class="line"><a name="l00130"></a><span class="lineno"> 130</span> <span class="comment">// when using this method and use proper validation and sanitization</span></div> +<div class="line"><a name="l00131"></a><span class="lineno"> 131</span> <span class="comment">// on the `command`. For this reason in general `os::spawn` is</span></div> +<div class="line"><a name="l00132"></a><span class="lineno"> 132</span> <span class="comment">// preferred if a shell is not required.</span></div> +<div class="line"><a name="l00133"></a><span class="lineno"><a class="line" href="namespaceos.html#a75eb48541200e89e498d3d324ffc3089"> 133</a></span> <span class="keyword">inline</span> <a class="code" href="classOption.html">Option<int></a> <a class="code" href="namespaceos.html#a75eb48541200e89e498d3d324ffc3089">system</a>(<span class="keyword">const</span> std::string& command)</div> +<div class="line"><a name="l00134"></a><span class="lineno"> 134</span> {</div> +<div class="line"><a name="l00135"></a><span class="lineno"> 135</span>  <a class="code" href="3rdparty_2stout_2include_2stout_2windows_8hpp.html#ab03ced250ed239bc3b50b669493997f9">pid_t</a> pid = ::fork();</div> +<div class="line"><a name="l00136"></a><span class="lineno"> 136</span>  <span class="keywordflow">if</span> (pid == -1) {</div> +<div class="line"><a name="l00137"></a><span class="lineno"> 137</span>  <span class="keywordflow">return</span> <a class="code" href="structNone.html">None</a>();</div> +<div class="line"><a name="l00138"></a><span class="lineno"> 138</span>  } <span class="keywordflow">else</span> <span class="keywordflow">if</span> (pid == 0) {</div> +<div class="line"><a name="l00139"></a><span class="lineno"> 139</span>  <span class="comment">// In child process.</span></div> +<div class="line"><a name="l00140"></a><span class="lineno"> 140</span>  <a class="code" href="namespaceos.html#a4b727e301623549c37cdfcd8c553a2c7">::execlp</a>(</div> +<div class="line"><a name="l00141"></a><span class="lineno"> 141</span>  <a class="code" href="namespaceos_1_1Shell.html#acfe16ef2b1146ad49a8651c0a457ce46">Shell::name</a>, <a class="code" href="namespaceos_1_1Shell.html#adeacb41dacfa03ad5ceebd9a53582997">Shell::arg0</a>, <a class="code" href="namespaceos_1_1Shell.html#a44f50f66f2a231de974b53c9f4384ba5">Shell::arg1</a>, command.c_str(), (<span class="keywordtype">char</span>*)<span class="keyword">nullptr</span>);</div> +<div class="line"><a name="l00142"></a><span class="lineno"> 142</span>  ::exit(127);</div> +<div class="line"><a name="l00143"></a><span class="lineno"> 143</span>  } <span class="keywordflow">else</span> {</div> +<div class="line"><a name="l00144"></a><span class="lineno"> 144</span>  <span class="comment">// In parent process.</span></div> +<div class="line"><a name="l00145"></a><span class="lineno"> 145</span>  <span class="keywordtype">int</span> <a class="code" href="namespaceproc.html#a34396c6140a28f583dc13fee3c3c35d4">status</a>;</div> +<div class="line"><a name="l00146"></a><span class="lineno"> 146</span>  <span class="keywordflow">while</span> (::<a class="code" href="namespaceos.html#a48c86262928f59c5c54d0cb0012e2aba">waitpid</a>(pid, &status, 0) == -1) {</div> +<div class="line"><a name="l00147"></a><span class="lineno"> 147</span>  <span class="keywordflow">if</span> (errno != EINTR) {</div> +<div class="line"><a name="l00148"></a><span class="lineno"> 148</span>  <span class="keywordflow">return</span> <a class="code" href="structNone.html">None</a>();</div> +<div class="line"><a name="l00149"></a><span class="lineno"> 149</span>  }</div> +<div class="line"><a name="l00150"></a><span class="lineno"> 150</span>  }</div> +<div class="line"><a name="l00151"></a><span class="lineno"> 151</span> </div> +<div class="line"><a name="l00152"></a><span class="lineno"> 152</span>  <span class="keywordflow">return</span> <a class="code" href="namespaceproc.html#a34396c6140a28f583dc13fee3c3c35d4">status</a>;</div> +<div class="line"><a name="l00153"></a><span class="lineno"> 153</span>  }</div> +<div class="line"><a name="l00154"></a><span class="lineno"> 154</span> }</div> +<div class="line"><a name="l00155"></a><span class="lineno"> 155</span> </div> +<div class="line"><a name="l00156"></a><span class="lineno"> 156</span> <span class="comment">// Executes a command by calling "<command> <arguments...>", and returns after</span></div> +<div class="line"><a name="l00157"></a><span class="lineno"> 157</span> <span class="comment">// the command has been completed. Returns the exit code on success and `None`</span></div> +<div class="line"><a name="l00158"></a><span class="lineno"> 158</span> <span class="comment">// on error (e.g., fork/exec/waitpid failed). This function is async signal</span></div> +<div class="line"><a name="l00159"></a><span class="lineno"> 159</span> <span class="comment">// safe. We return an `Option<int>` instead of a `Try<int>`, because although</span></div> +<div class="line"><a name="l00160"></a><span class="lineno"> 160</span> <span class="comment">// `Try` does not dynamically allocate, `Error` uses `std::string`, which is</span></div> +<div class="line"><a name="l00161"></a><span class="lineno"> 161</span> <span class="comment">// not async signal safe.</span></div> +<div class="line"><a name="l00162"></a><span class="lineno"><a class="line" href="namespaceos.html#a18f614e5bdf40984c33888a5fa9599ca"> 162</a></span> <span class="keyword">inline</span> <a class="code" href="classOption.html">Option<int></a> <a class="code" href="namespaceos.html#a18f614e5bdf40984c33888a5fa9599ca">spawn</a>(</div> +<div class="line"><a name="l00163"></a><span class="lineno"> 163</span>  <span class="keyword">const</span> std::string& command,</div> +<div class="line"><a name="l00164"></a><span class="lineno"> 164</span>  <span class="keyword">const</span> std::vector<std::string>& arguments)</div> +<div class="line"><a name="l00165"></a><span class="lineno"> 165</span> {</div> +<div class="line"><a name="l00166"></a><span class="lineno"> 166</span>  <a class="code" href="3rdparty_2stout_2include_2stout_2windows_8hpp.html#ab03ced250ed239bc3b50b669493997f9">pid_t</a> pid = ::fork();</div> +<div class="line"><a name="l00167"></a><span class="lineno"> 167</span> </div> +<div class="line"><a name="l00168"></a><span class="lineno"> 168</span>  <span class="keywordflow">if</span> (pid == -1) {</div> +<div class="line"><a name="l00169"></a><span class="lineno"> 169</span>  <span class="keywordflow">return</span> <a class="code" href="structNone.html">None</a>();</div> +<div class="line"><a name="l00170"></a><span class="lineno"> 170</span>  } <span class="keywordflow">else</span> <span class="keywordflow">if</span> (pid == 0) {</div> +<div class="line"><a name="l00171"></a><span class="lineno"> 171</span>  <span class="comment">// In child process.</span></div> +<div class="line"><a name="l00172"></a><span class="lineno"> 172</span>  <a class="code" href="namespaceos.html#a0b80877b34088be8d5ba3eb9b0567ed7">::execvp</a>(command.c_str(), <a class="code" href="classos_1_1raw_1_1Argv.html">os::raw::Argv</a>(arguments));</div> +<div class="line"><a name="l00173"></a><span class="lineno"> 173</span>  ::exit(127);</div> +<div class="line"><a name="l00174"></a><span class="lineno"> 174</span>  } <span class="keywordflow">else</span> {</div> +<div class="line"><a name="l00175"></a><span class="lineno"> 175</span>  <span class="comment">// In parent process.</span></div> +<div class="line"><a name="l00176"></a><span class="lineno"> 176</span>  <span class="keywordtype">int</span> <a class="code" href="namespaceproc.html#a34396c6140a28f583dc13fee3c3c35d4">status</a>;</div> +<div class="line"><a name="l00177"></a><span class="lineno"> 177</span>  <span class="keywordflow">while</span> (::<a class="code" href="namespaceos.html#a48c86262928f59c5c54d0cb0012e2aba">waitpid</a>(pid, &status, 0) == -1) {</div> +<div class="line"><a name="l00178"></a><span class="lineno"> 178</span>  <span class="keywordflow">if</span> (errno != EINTR) {</div> +<div class="line"><a name="l00179"></a><span class="lineno"> 179</span>  <span class="keywordflow">return</span> <a class="code" href="structNone.html">None</a>();</div> +<div class="line"><a name="l00180"></a><span class="lineno"> 180</span>  }</div> +<div class="line"><a name="l00181"></a><span class="lineno"> 181</span>  }</div> +<div class="line"><a name="l00182"></a><span class="lineno"> 182</span> </div> +<div class="line"><a name="l00183"></a><span class="lineno"> 183</span>  <span class="keywordflow">return</span> <a class="code" href="namespaceproc.html#a34396c6140a28f583dc13fee3c3c35d4">status</a>;</div> +<div class="line"><a name="l00184"></a><span class="lineno"> 184</span>  }</div> +<div class="line"><a name="l00185"></a><span class="lineno"> 185</span> }</div> +<div class="line"><a name="l00186"></a><span class="lineno"> 186</span> </div> +<div class="line"><a name="l00187"></a><span class="lineno"> 187</span> </div> +<div class="line"><a name="l00188"></a><span class="lineno"> 188</span> <span class="keyword">template</span><<span class="keyword">typename</span>... T></div> +<div class="line"><a name="l00189"></a><span class="lineno"><a class="line" href="namespaceos.html#a4b727e301623549c37cdfcd8c553a2c7"> 189</a></span> <span class="keyword">inline</span> <span class="keywordtype">int</span> <a class="code" href="namespaceos.html#a4b727e301623549c37cdfcd8c553a2c7">execlp</a>(<span class="keyword">const</span> <span class="keywordtype">char</span>* <a class="code" href="namespacemesos_1_1uri.html#a0a3b30c1eb427c4053aaef120b1f453c">file</a>, T... t)</div> +<div class="line"><a name="l00190"></a><span class="lineno"> 190</span> {</div> +<div class="line"><a name="l00191"></a><span class="lineno"> 191</span>  <a class="code" href="namespaceos.html#a4b727e301623549c37cdfcd8c553a2c7">return ::execlp</a>(file, t...);</div> +<div class="line"><a name="l00192"></a><span class="lineno"> 192</span> }</div> +<div class="line"><a name="l00193"></a><span class="lineno"> 193</span> </div> +<div class="line"><a name="l00194"></a><span class="lineno"> 194</span> </div> +<div class="line"><a name="l00195"></a><span class="lineno"><a class="line" href="namespaceos.html#a0b80877b34088be8d5ba3eb9b0567ed7"> 195</a></span> <span class="keyword">inline</span> <span class="keywordtype">int</span> <a class="code" href="namespaceos.html#a0b80877b34088be8d5ba3eb9b0567ed7">execvp</a>(<span class="keyword">const</span> <span class="keywordtype">char</span>* <a class="code" href="namespacemesos_1_1uri.html#a0a3b30c1eb427c4053aaef120b1f453c">file</a>, <span class="keywordtype">char</span>* <span class="keyword">const</span> argv[])</div> +<div class="line"><a name="l00196"></a><span class="lineno"> 196</span> {</div> +<div class="line"><a name="l00197"></a><span class="lineno"> 197</span>  <a class="code" href="namespaceos.html#a0b80877b34088be8d5ba3eb9b0567ed7">return ::execvp</a>(file, argv);</div> +<div class="line"><a name="l00198"></a><span class="lineno"> 198</span> }</div> +<div class="line"><a name="l00199"></a><span class="lineno"> 199</span> </div> +<div class="line"><a name="l00200"></a><span class="lineno"> 200</span> } <span class="comment">// namespace os {</span></div> +<div class="line"><a name="l00201"></a><span class="lineno"> 201</span> </div> +<div class="line"><a name="l00202"></a><span class="lineno"> 202</span> <span class="preprocessor">#endif // __STOUT_OS_POSIX_SHELL_HPP__</span></div> +<div class="ttc" id="namespaceos_1_1Shell_html_a44f50f66f2a231de974b53c9f4384ba5"><div class="ttname"><a href="namespaceos_1_1Shell.html#a44f50f66f2a231de974b53c9f4384ba5">os::Shell::arg1</a></div><div class="ttdeci">constexpr const char * arg1</div><div class="ttdef"><b>Definition:</b> shell.hpp:45</div></div> <div class="ttc" id="classError_html"><div class="ttname"><a href="classError.html">Error</a></div><div class="ttdef"><b>Definition:</b> errorbase.hpp:35</div></div> +<div class="ttc" id="classOption_html"><div class="ttname"><a href="classOption.html">Option< int ></a></div></div> <div class="ttc" id="classTry_html_a8bc7f43e75a47111ea18e9c83b007be5"><div class="ttname"><a href="classTry.html#a8bc7f43e75a47111ea18e9c83b007be5">Try::get</a></div><div class="ttdeci">T & get()&</div><div class="ttdef"><b>Definition:</b> try.hpp:73</div></div> <div class="ttc" id="classTry_html"><div class="ttname"><a href="classTry.html">Try</a></div><div class="ttdef"><b>Definition:</b> check.hpp:33</div></div> -<div class="ttc" id="namespaceos_html_a59cf3d26475f4001630e0e362e7a3ff7"><div class="ttname"><a href="namespaceos.html#a59cf3d26475f4001630e0e362e7a3ff7">os::spawn</a></div><div class="ttdeci">int spawn(const std::string &command, const std::vector< std::string > &arguments)</div><div class="ttdef"><b>Definition:</b> shell.hpp:159</div></div> -<div class="ttc" id="namespaceos_html_a4b727e301623549c37cdfcd8c553a2c7"><div class="ttname"><a href="namespaceos.html#a4b727e301623549c37cdfcd8c553a2c7">os::execlp</a></div><div class="ttdeci">int execlp(const char *file, T...t)</div><div class="ttdef"><b>Definition:</b> shell.hpp:186</div></div> +<div class="ttc" id="namespaceos_html_a4b727e301623549c37cdfcd8c553a2c7"><div class="ttname"><a href="namespaceos.html#a4b727e301623549c37cdfcd8c553a2c7">os::execlp</a></div><div class="ttdeci">int execlp(const char *file, T...t)</div><div class="ttdef"><b>Definition:</b> shell.hpp:189</div></div> <div class="ttc" id="3rdparty_2stout_2include_2stout_2windows_8hpp_html_a3858fc90369448097210e69437ca7c66"><div class="ttname"><a href="3rdparty_2stout_2include_2stout_2windows_8hpp.html#a3858fc90369448097210e69437ca7c66">strsignal</a></div><div class="ttdeci">const char * strsignal(int signum)</div><div class="ttdef"><b>Definition:</b> windows.hpp:358</div></div> <div class="ttc" id="namespaceproc_html_a34396c6140a28f583dc13fee3c3c35d4"><div class="ttname"><a href="namespaceproc.html#a34396c6140a28f583dc13fee3c3c35d4">proc::status</a></div><div class="ttdeci">Result< ProcessStatus > status(pid_t pid)</div><div class="ttdef"><b>Definition:</b> proc.hpp:166</div></div> <div class="ttc" id="format_8hpp_html"><div class="ttname"><a href="format_8hpp.html">format.hpp</a></div></div> -<div class="ttc" id="namespaceos_1_1Shell_html_adeacb41dacfa03ad5ceebd9a53582997"><div class="ttname"><a href="namespaceos_1_1Shell.html#adeacb41dacfa03ad5ceebd9a53582997">os::Shell::arg0</a></div><div class="ttdeci">constexpr const char * arg0</div><div class="ttdef"><b>Definition:</b> shell.hpp:42</div></div> -<div class="ttc" id="namespaceos_html_a0b80877b34088be8d5ba3eb9b0567ed7"><div class="ttname"><a href="namespaceos.html#a0b80877b34088be8d5ba3eb9b0567ed7">os::execvp</a></div><div class="ttdeci">int execvp(const char *file, char *const argv[])</div><div class="ttdef"><b>Definition:</b> shell.hpp:192</div></div> +<div class="ttc" id="none_8hpp_html"><div class="ttname"><a href="none_8hpp.html">none.hpp</a></div></div> +<div class="ttc" id="namespaceos_html_a18f614e5bdf40984c33888a5fa9599ca"><div class="ttname"><a href="namespaceos.html#a18f614e5bdf40984c33888a5fa9599ca">os::spawn</a></div><div class="ttdeci">Option< int > spawn(const std::string &command, const std::vector< std::string > &arguments)</div><div class="ttdef"><b>Definition:</b> shell.hpp:162</div></div> +<div class="ttc" id="namespaceos_1_1Shell_html_adeacb41dacfa03ad5ceebd9a53582997"><div class="ttname"><a href="namespaceos_1_1Shell.html#adeacb41dacfa03ad5ceebd9a53582997">os::Shell::arg0</a></div><div class="ttdeci">constexpr const char * arg0</div><div class="ttdef"><b>Definition:</b> shell.hpp:44</div></div> +<div class="ttc" id="namespaceos_html_a0b80877b34088be8d5ba3eb9b0567ed7"><div class="ttname"><a href="namespaceos.html#a0b80877b34088be8d5ba3eb9b0567ed7">os::execvp</a></div><div class="ttdeci">int execvp(const char *file, char *const argv[])</div><div class="ttdef"><b>Definition:</b> shell.hpp:195</div></div> <div class="ttc" id="classos_1_1raw_1_1Argv_html"><div class="ttname"><a href="classos_1_1raw_1_1Argv.html">os::raw::Argv</a></div><div class="ttdoc">Represent the argument list expected by execv routines. </div><div class="ttdef"><b>Definition:</b> argv.hpp:36</div></div> <div class="ttc" id="3rdparty_2stout_2include_2stout_2windows_8hpp_html_ab03ced250ed239bc3b50b669493997f9"><div class="ttname"><a href="3rdparty_2stout_2include_2stout_2windows_8hpp.html#ab03ced250ed239bc3b50b669493997f9">pid_t</a></div><div class="ttdeci">DWORD pid_t</div><div class="ttdef"><b>Definition:</b> windows.hpp:187</div></div> <div class="ttc" id="namespacemesos_1_1uri_html_a0a3b30c1eb427c4053aaef120b1f453c"><div class="ttname"><a href="namespacemesos_1_1uri.html#a0a3b30c1eb427c4053aaef120b1f453c">mesos::uri::file</a></div><div class="ttdeci">URI file(const std::string &path)</div><div class="ttdoc">Creates a file URI with the given path on the local host. </div><div class="ttdef"><b>Definition:</b> file.hpp:33</div></div> -<div class="ttc" id="3rdparty_2stout_2include_2stout_2windows_8hpp_html_a6953e62fd0dec274a397678d31c344b4"><div class="ttname"><a href="3rdparty_2stout_2include_2stout_2windows_8hpp.html#a6953e62fd0dec274a397678d31c344b4">WIFSIGNALED</a></div><div class="ttdeci">#define WIFSIGNALED(x)</div><div class="ttdef"><b>Definition:</b> windows.hpp:380</div></div> +<div class="ttc" id="3rdparty_2stout_2include_2stout_2windows_8hpp_html_a6953e62fd0dec274a397678d31c344b4"><div class="ttname"><a href="3rdparty_2stout_2include_2stout_2windows_8hpp.html#a6953e62fd0dec274a397678d31c344b4">WIFSIGNALED</a></div><div class="ttdeci">#define WIFSIGNALED(x)</div><div class="ttdef"><b>Definition:</b> windows.hpp:387</div></div> <div class="ttc" id="namespaceos_html_a48c86262928f59c5c54d0cb0012e2aba"><div class="ttname"><a href="namespaceos.html#a48c86262928f59c5c54d0cb0012e2aba">os::waitpid</a></div><div class="ttdeci">Result< pid_t > waitpid(pid_t pid, int *status, int options)</div><div class="ttdef"><b>Definition:</b> os.hpp:141</div></div> -<div class="ttc" id="3rdparty_2stout_2include_2stout_2windows_8hpp_html_ae0c8840076dd63d5e2367fff4f7f46f3"><div class="ttname"><a href="3rdparty_2stout_2include_2stout_2windows_8hpp.html#ae0c8840076dd63d5e2367fff4f7f46f3">WEXITSTATUS</a></div><div class="ttdeci">#define WEXITSTATUS(x)</div><div class="ttdef"><b>Definition:</b> windows.hpp:376</div></div> +<div class="ttc" id="option_8hpp_html"><div class="ttname"><a href="option_8hpp.html">option.hpp</a></div></div> +<div class="ttc" id="3rdparty_2stout_2include_2stout_2windows_8hpp_html_ae0c8840076dd63d5e2367fff4f7f46f3"><div class="ttname"><a href="3rdparty_2stout_2include_2stout_2windows_8hpp.html#ae0c8840076dd63d5e2367fff4f7f46f3">WEXITSTATUS</a></div><div class="ttdeci">#define WEXITSTATUS(x)</div><div class="ttdef"><b>Definition:</b> windows.hpp:379</div></div> <div class="ttc" id="classTry_html_aec4a11ddd3c036e889d90b7eb6258ba7"><div class="ttname"><a href="classTry.html#aec4a11ddd3c036e889d90b7eb6258ba7">Try::error</a></div><div class="ttdeci">static Try error(const E &e)</div><div class="ttdef"><b>Definition:</b> try.hpp:42</div></div> -<div class="ttc" id="namespaceos_html_a0d86320d7799ea761599bc356c02a4fa"><div class="ttname"><a href="namespaceos.html#a0d86320d7799ea761599bc356c02a4fa">os::shell</a></div><div class="ttdeci">Try< std::string > shell(const std::string &fmt, const T &...t)</div><div class="ttdoc">Runs a shell command with optional arguments. </div><div class="ttdef"><b>Definition:</b> shell.hpp:71</div></div> +<div class="ttc" id="namespaceos_html_a0d86320d7799ea761599bc356c02a4fa"><div class="ttname"><a href="namespaceos.html#a0d86320d7799ea761599bc356c02a4fa">os::shell</a></div><div class="ttdeci">Try< std::string > shell(const std::string &fmt, const T &...t)</div><div class="ttdoc">Runs a shell command with optional arguments. </div><div class="ttdef"><b>Definition:</b> shell.hpp:73</div></div> <div class="ttc" id="error_8hpp_html"><div class="ttname"><a href="error_8hpp.html">error.hpp</a></div></div> +<div class="ttc" id="structNone_html"><div class="ttname"><a href="structNone.html">None</a></div><div class="ttdef"><b>Definition:</b> none.hpp:27</div></div> <div class="ttc" id="classTry_html_a0b98f95163b8a38daafd1651b043a276"><div class="ttname"><a href="classTry.html#a0b98f95163b8a38daafd1651b043a276">Try::isError</a></div><div class="ttdeci">bool isError() const </div><div class="ttdef"><b>Definition:</b> try.hpp:71</div></div> <div class="ttc" id="try_8hpp_html"><div class="ttname"><a href="try_8hpp.html">try.hpp</a></div></div> -<div class="ttc" id="3rdparty_2stout_2include_2stout_2windows_8hpp_html_aeba4d421572a9d681c73c347f24ad348"><div class="ttname"><a href="3rdparty_2stout_2include_2stout_2windows_8hpp.html#aeba4d421572a9d681c73c347f24ad348">WTERMSIG</a></div><div class="ttdeci">#define WTERMSIG(x)</div><div class="ttdef"><b>Definition:</b> windows.hpp:386</div></div> <div class="ttc" id="namespacestrings_1_1internal_html_a870e2db270d980f83de20525ec414d2a"><div class="ttname"><a href="namespacestrings_1_1internal.html#a870e2db270d980f83de20525ec414d2a">strings::internal::format</a></div><div class="ttdeci">Try< std::string > format(const std::string &fmt, va_list args)</div><div class="ttdef"><b>Definition:</b> format.hpp:68</div></div> <div class="ttc" id="namespacens_html_a28116b46e6543597a11733424cd1aa20"><div class="ttname"><a href="namespacens.html#a28116b46e6543597a11733424cd1aa20">ns::stringify</a></div><div class="ttdeci">std::string stringify(int flags)</div></div> -<div class="ttc" id="namespaceos_1_1Shell_html_acfe16ef2b1146ad49a8651c0a457ce46"><div class="ttname"><a href="namespaceos_1_1Shell.html#acfe16ef2b1146ad49a8651c0a457ce46">os::Shell::name</a></div><div class="ttdeci">constexpr const char * name</div><div class="ttdef"><b>Definition:</b> shell.hpp:41</div></div> -<div class="ttc" id="namespaceos_html_a3491ce5d4a57fcac5ca2e3ca40abe176"><div class="ttname"><a href="namespaceos.html#a3491ce5d4a57fcac5ca2e3ca40abe176">os::system</a></div><div class="ttdeci">int system(const std::string &command)</div><div class="ttdef"><b>Definition:</b> shell.hpp:130</div></div> +<div class="ttc" id="namespaceos_1_1Shell_html_acfe16ef2b1146ad49a8651c0a457ce46"><div class="ttname"><a href="namespaceos_1_1Shell.html#acfe16ef2b1146ad49a8651c0a457ce46">os::Shell::name</a></div><div class="ttdeci">constexpr const char * name</div><div class="ttdef"><b>Definition:</b> shell.hpp:43</div></div> +<div class="ttc" id="namespaceos_html_a75eb48541200e89e498d3d324ffc3089"><div class="ttname"><a href="namespaceos.html#a75eb48541200e89e498d3d324ffc3089">os::system</a></div><div class="ttdeci">Option< int > system(const std::string &command)</div><div class="ttdef"><b>Definition:</b> shell.hpp:133</div></div> <div class="ttc" id="argv_8hpp_html"><div class="ttname"><a href="argv_8hpp.html">argv.hpp</a></div></div> </div><!-- fragment --></div><!-- contents --> <!-- start footer part -->
http://git-wip-us.apache.org/repos/asf/mesos-site/blob/2306ff3e/content/api/latest/c++/posix_2xattr_8hpp_source.html ---------------------------------------------------------------------- diff --git a/content/api/latest/c++/posix_2xattr_8hpp_source.html b/content/api/latest/c++/posix_2xattr_8hpp_source.html index a424078..d2709bd 100644 --- a/content/api/latest/c++/posix_2xattr_8hpp_source.html +++ b/content/api/latest/c++/posix_2xattr_8hpp_source.html @@ -199,7 +199,7 @@ <div class="ttc" id="try_8hpp_html"><div class="ttname"><a href="try_8hpp.html">try.hpp</a></div></div> <div class="ttc" id="namespaceos_html_aa3debc8caa054e7a0a3bfe4aa42aae07"><div class="ttname"><a href="namespaceos.html#aa3debc8caa054e7a0a3bfe4aa42aae07">os::temp</a></div><div class="ttdeci">std::string temp()</div><div class="ttdef"><b>Definition:</b> temp.hpp:27</div></div> <div class="ttc" id="namespaceos_html_aa425b9a1dc9aff1039cb644a15388f18"><div class="ttname"><a href="namespaceos.html#aa425b9a1dc9aff1039cb644a15388f18">os::getxattr</a></div><div class="ttdeci">Try< std::string > getxattr(const std::string &path, const std::string &name)</div><div class="ttdef"><b>Definition:</b> xattr.hpp:67</div></div> -<div class="ttc" id="namespaceos_1_1Shell_html_acfe16ef2b1146ad49a8651c0a457ce46"><div class="ttname"><a href="namespaceos_1_1Shell.html#acfe16ef2b1146ad49a8651c0a457ce46">os::Shell::name</a></div><div class="ttdeci">constexpr const char * name</div><div class="ttdef"><b>Definition:</b> shell.hpp:41</div></div> +<div class="ttc" id="namespaceos_1_1Shell_html_acfe16ef2b1146ad49a8651c0a457ce46"><div class="ttname"><a href="namespaceos_1_1Shell.html#acfe16ef2b1146ad49a8651c0a457ce46">os::Shell::name</a></div><div class="ttdeci">constexpr const char * name</div><div class="ttdef"><b>Definition:</b> shell.hpp:43</div></div> </div><!-- fragment --></div><!-- contents --> <!-- start footer part --> <hr class="footer"/><address class="footer"><small> http://git-wip-us.apache.org/repos/asf/mesos-site/blob/2306ff3e/content/api/latest/c++/queueing_2internal_8hpp_source.html ---------------------------------------------------------------------- diff --git a/content/api/latest/c++/queueing_2internal_8hpp_source.html b/content/api/latest/c++/queueing_2internal_8hpp_source.html index 41b05c2..2bc94bf 100644 --- a/content/api/latest/c++/queueing_2internal_8hpp_source.html +++ b/content/api/latest/c++/queueing_2internal_8hpp_source.html @@ -429,7 +429,7 @@ <div class="ttc" id="src_2linux_2routing_2queueing_2statistics_8hpp_html"><div class="ttname"><a href="src_2linux_2routing_2queueing_2statistics_8hpp.html">statistics.hpp</a></div></div> <div class="ttc" id="namespacerouting_html_a728e253aba8e42f601752ddc771e9902"><div class="ttname"><a href="namespacerouting.html#a728e253aba8e42f601752ddc771e9902">routing::cleanup</a></div><div class="ttdeci">void cleanup(struct rtnl_cls *cls)</div><div class="ttdef"><b>Definition:</b> internal.hpp:64</div></div> <div class="ttc" id="namespacerouting_html_aee51d4e36a57bab7d6ada56e15467370"><div class="ttname"><a href="namespacerouting.html#aee51d4e36a57bab7d6ada56e15467370">routing::socket</a></div><div class="ttdeci">Try< Netlink< struct nl_sock > > socket(int protocol=NETLINK_ROUTE)</div><div class="ttdef"><b>Definition:</b> internal.hpp:91</div></div> -<div class="ttc" id="namespaceos_1_1Shell_html_acfe16ef2b1146ad49a8651c0a457ce46"><div class="ttname"><a href="namespaceos_1_1Shell.html#acfe16ef2b1146ad49a8651c0a457ce46">os::Shell::name</a></div><div class="ttdeci">constexpr const char * name</div><div class="ttdef"><b>Definition:</b> shell.hpp:41</div></div> +<div class="ttc" id="namespaceos_1_1Shell_html_acfe16ef2b1146ad49a8651c0a457ce46"><div class="ttname"><a href="namespaceos_1_1Shell.html#acfe16ef2b1146ad49a8651c0a457ce46">os::Shell::name</a></div><div class="ttdeci">constexpr const char * name</div><div class="ttdef"><b>Definition:</b> shell.hpp:43</div></div> <div class="ttc" id="classrouting_1_1Handle_html_aaaf5d48afa385557421c29db03c27caf"><div class="ttname"><a href="classrouting_1_1Handle.html#aaaf5d48afa385557421c29db03c27caf">routing::Handle::get</a></div><div class="ttdeci">constexpr uint32_t get() const </div><div class="ttdef"><b>Definition:</b> handle.hpp:66</div></div> <div class="ttc" id="namespacerouting_1_1queueing_1_1internal_html_a9692817d57aa1e0599afef0fd7e17ee7"><div class="ttname"><a href="namespacerouting_1_1queueing_1_1internal.html#a9692817d57aa1e0599afef0fd7e17ee7">routing::queueing::internal::decode</a></div><div class="ttdeci">Result< Config > decode(const Netlink< struct rtnl_qdisc > &qdisc)</div></div> <div class="ttc" id="structrouting_1_1queueing_1_1Discipline_html_a51acd08c88f4883eb14c2c86d09e2fdc"><div class="ttname"><a href="structrouting_1_1queueing_1_1Discipline.html#a51acd08c88f4883eb14c2c86d09e2fdc">routing::queueing::Discipline::parent</a></div><div class="ttdeci">Handle parent</div><div class="ttdef"><b>Definition:</b> discipline.hpp:43</div></div> http://git-wip-us.apache.org/repos/asf/mesos-site/blob/2306ff3e/content/api/latest/c++/resolver_8hpp_source.html ---------------------------------------------------------------------- diff --git a/content/api/latest/c++/resolver_8hpp_source.html b/content/api/latest/c++/resolver_8hpp_source.html index 8586540..7ef8fcc 100644 --- a/content/api/latest/c++/resolver_8hpp_source.html +++ b/content/api/latest/c++/resolver_8hpp_source.html @@ -119,7 +119,7 @@ <div class="ttc" id="structNone_html"><div class="ttname"><a href="structNone.html">None</a></div><div class="ttdef"><b>Definition:</b> none.hpp:27</div></div> <div class="ttc" id="classmesos_1_1SecretResolver_html_a2e9fb0d097791fbc1b3954c004f66143"><div class="ttname"><a href="classmesos_1_1SecretResolver.html#a2e9fb0d097791fbc1b3954c004f66143">mesos::SecretResolver::SecretResolver</a></div><div class="ttdeci">SecretResolver()</div><div class="ttdef"><b>Definition:</b> resolver.hpp:52</div></div> <div class="ttc" id="classmesos_1_1SecretResolver_html"><div class="ttname"><a href="classmesos_1_1SecretResolver.html">mesos::SecretResolver</a></div><div class="ttdef"><b>Definition:</b> resolver.hpp:34</div></div> -<div class="ttc" id="namespaceos_1_1Shell_html_acfe16ef2b1146ad49a8651c0a457ce46"><div class="ttname"><a href="namespaceos_1_1Shell.html#acfe16ef2b1146ad49a8651c0a457ce46">os::Shell::name</a></div><div class="ttdeci">constexpr const char * name</div><div class="ttdef"><b>Definition:</b> shell.hpp:41</div></div> +<div class="ttc" id="namespaceos_1_1Shell_html_acfe16ef2b1146ad49a8651c0a457ce46"><div class="ttname"><a href="namespaceos_1_1Shell.html#acfe16ef2b1146ad49a8651c0a457ce46">os::Shell::name</a></div><div class="ttdeci">constexpr const char * name</div><div class="ttdef"><b>Definition:</b> shell.hpp:43</div></div> <div class="ttc" id="classprocess_1_1Future_html"><div class="ttname"><a href="classprocess_1_1Future.html">process::Future</a></div><div class="ttdef"><b>Definition:</b> future.hpp:57</div></div> </div><!-- fragment --></div><!-- contents --> <!-- start footer part --> http://git-wip-us.apache.org/repos/asf/mesos-site/blob/2306ff3e/content/api/latest/c++/resource__provider_2storage_2disk__profile_8hpp_source.html ---------------------------------------------------------------------- diff --git a/content/api/latest/c++/resource__provider_2storage_2disk__profile_8hpp_source.html b/content/api/latest/c++/resource__provider_2storage_2disk__profile_8hpp_source.html index 2e9d29b..41a6d1e 100644 --- a/content/api/latest/c++/resource__provider_2storage_2disk__profile_8hpp_source.html +++ b/content/api/latest/c++/resource__provider_2storage_2disk__profile_8hpp_source.html @@ -141,7 +141,7 @@ <div class="ttc" id="classmesos_1_1DiskProfileAdaptor_html_a7a417ba4b641b9870944549a1309b1b5"><div class="ttname"><a href="classmesos_1_1DiskProfileAdaptor.html#a7a417ba4b641b9870944549a1309b1b5">mesos::DiskProfileAdaptor::create</a></div><div class="ttdeci">static Try< DiskProfileAdaptor * > create(const Option< std::string > &name=None())</div><div class="ttdoc">Factory method used to create a DiskProfileAdaptor instance. </div></div> <div class="ttc" id="classmesos_1_1DiskProfileAdaptor_html_abab31d0a5be607d0a7541df1ad8e23c1"><div class="ttname"><a href="classmesos_1_1DiskProfileAdaptor.html#abab31d0a5be607d0a7541df1ad8e23c1">mesos::DiskProfileAdaptor::DiskProfileAdaptor</a></div><div class="ttdeci">DiskProfileAdaptor()</div><div class="ttdef"><b>Definition:</b> disk_profile.hpp:144</div></div> <div class="ttc" id="include_2csi_2spec_8hpp_html"><div class="ttname"><a href="include_2csi_2spec_8hpp.html">spec.hpp</a></div></div> -<div class="ttc" id="namespaceos_1_1Shell_html_acfe16ef2b1146ad49a8651c0a457ce46"><div class="ttname"><a href="namespaceos_1_1Shell.html#acfe16ef2b1146ad49a8651c0a457ce46">os::Shell::name</a></div><div class="ttdeci">constexpr const char * name</div><div class="ttdef"><b>Definition:</b> shell.hpp:41</div></div> +<div class="ttc" id="namespaceos_1_1Shell_html_acfe16ef2b1146ad49a8651c0a457ce46"><div class="ttname"><a href="namespaceos_1_1Shell.html#acfe16ef2b1146ad49a8651c0a457ce46">os::Shell::name</a></div><div class="ttdeci">constexpr const char * name</div><div class="ttdef"><b>Definition:</b> shell.hpp:43</div></div> <div class="ttc" id="classprocess_1_1Future_html"><div class="ttname"><a href="classprocess_1_1Future.html">process::Future</a></div><div class="ttdef"><b>Definition:</b> future.hpp:57</div></div> </div><!-- fragment --></div><!-- contents --> <!-- start footer part --> http://git-wip-us.apache.org/repos/asf/mesos-site/blob/2306ff3e/content/api/latest/c++/resources_8hpp_source.html ---------------------------------------------------------------------- diff --git a/content/api/latest/c++/resources_8hpp_source.html b/content/api/latest/c++/resources_8hpp_source.html index 4ea26ce..5e80a47 100644 --- a/content/api/latest/c++/resources_8hpp_source.html +++ b/content/api/latest/c++/resources_8hpp_source.html @@ -777,7 +777,7 @@ <div class="ttc" id="classmesos_1_1Resources_html_a25edbf9ca3dc21aec283b25e48308794"><div class="ttname"><a href="classmesos_1_1Resources.html#a25edbf9ca3dc21aec283b25e48308794">mesos::Resources::disk</a></div><div class="ttdeci">Option< Bytes > disk() const </div></div> <div class="ttc" id="namespacemesos_html_a05acb02d51a29432792fb088b7ee5c1f"><div class="ttname"><a href="namespacemesos.html#a05acb02d51a29432792fb088b7ee5c1f">mesos::operator+=</a></div><div class="ttdeci">hashmap< Key, Resources > & operator+=(hashmap< Key, Resources > &left, const hashmap< Key, Resources > &right)</div><div class="ttdef"><b>Definition:</b> resources.hpp:677</div></div> <div class="ttc" id="classmesos_1_1Resources_html_a2233c5eae93c7bd8629495f19346575e"><div class="ttname"><a href="classmesos_1_1Resources.html#a2233c5eae93c7bd8629495f19346575e">mesos::Resources::operator-</a></div><div class="ttdeci">Resources operator-(const Resource &that) const </div></div> -<div class="ttc" id="namespaceos_1_1Shell_html_acfe16ef2b1146ad49a8651c0a457ce46"><div class="ttname"><a href="namespaceos_1_1Shell.html#acfe16ef2b1146ad49a8651c0a457ce46">os::Shell::name</a></div><div class="ttdeci">constexpr const char * name</div><div class="ttdef"><b>Definition:</b> shell.hpp:41</div></div> +<div class="ttc" id="namespaceos_1_1Shell_html_acfe16ef2b1146ad49a8651c0a457ce46"><div class="ttname"><a href="namespaceos_1_1Shell.html#acfe16ef2b1146ad49a8651c0a457ce46">os::Shell::name</a></div><div class="ttdeci">constexpr const char * name</div><div class="ttdef"><b>Definition:</b> shell.hpp:43</div></div> <div class="ttc" id="hashmap_8hpp_html"><div class="ttname"><a href="hashmap_8hpp.html">hashmap.hpp</a></div></div> <div class="ttc" id="classmesos_1_1Resources_html_af45f5789dd4c9d7345e47a072b37f9b4"><div class="ttname"><a href="classmesos_1_1Resources.html#af45f5789dd4c9d7345e47a072b37f9b4">mesos::Resources::reservationRole</a></div><div class="ttdeci">static const std::string & reservationRole(const Resource &resource)</div></div> <div class="ttc" id="classmesos_1_1Resources_html_ab2c34cf1de471159a32b8e9c9d8cbe79"><div class="ttname"><a href="classmesos_1_1Resources.html#ab2c34cf1de471159a32b8e9c9d8cbe79">mesos::Resources::allocations</a></div><div class="ttdeci">hashmap< std::string, Resources > allocations() const </div></div> http://git-wip-us.apache.org/repos/asf/mesos-site/blob/2306ff3e/content/api/latest/c++/slave_2containerizer_2docker_8hpp_source.html ---------------------------------------------------------------------- diff --git a/content/api/latest/c++/slave_2containerizer_2docker_8hpp_source.html b/content/api/latest/c++/slave_2containerizer_2docker_8hpp_source.html index a186851..7099c4c 100644 --- a/content/api/latest/c++/slave_2containerizer_2docker_8hpp_source.html +++ b/content/api/latest/c++/slave_2containerizer_2docker_8hpp_source.html @@ -626,7 +626,7 @@ <div class="ttc" id="classprocess_1_1Owned_html"><div class="ttname"><a href="classprocess_1_1Owned.html">process::Owned< mesos::slave::ContainerLogger ></a></div></div> <div class="ttc" id="classprocess_1_1Process_html"><div class="ttname"><a href="classprocess_1_1Process.html">process::Process</a></div><div class="ttdef"><b>Definition:</b> process.hpp:493</div></div> <div class="ttc" id="classmesos_1_1internal_1_1slave_1_1DockerContainerizerProcess_html_abcad81a9a5628d8f2d725f29890f8f00"><div class="ttname"><a href="classmesos_1_1internal_1_1slave_1_1DockerContainerizerProcess.html#abcad81a9a5628d8f2d725f29890f8f00">mesos::internal::slave::DockerContainerizerProcess::DockerContainerizerProcess</a></div><div class="ttdeci">DockerContainerizerProcess(const Flags &_flags, Fetcher *_fetcher, const process::Owned< mesos::slave::ContainerLogger > &_logger, process::Shared< Docker > _docker, const Option< NvidiaComponents > &_nvidia)</div><div class="ttdef"><b>Definition:</b> docker.hpp:125</div></div> -<div class="ttc" id="namespaceos_1_1Shell_html_acfe16ef2b1146ad49a8651c0a457ce46"><div class="ttname"><a href="namespaceos_1_1Shell.html#acfe16ef2b1146ad49a8651c0a457ce46">os::Shell::name</a></div><div class="ttdeci">constexpr const char * name</div><div class="ttdef"><b>Definition:</b> shell.hpp:41</div></div> +<div class="ttc" id="namespaceos_1_1Shell_html_acfe16ef2b1146ad49a8651c0a457ce46"><div class="ttname"><a href="namespaceos_1_1Shell.html#acfe16ef2b1146ad49a8651c0a457ce46">os::Shell::name</a></div><div class="ttdeci">constexpr const char * name</div><div class="ttdef"><b>Definition:</b> shell.hpp:43</div></div> <div class="ttc" id="classmesos_1_1internal_1_1slave_1_1DockerContainerizer_html_a40ada9b4cf916d4c22ec8c0a8536b3d3"><div class="ttname"><a href="classmesos_1_1internal_1_1slave_1_1DockerContainerizer.html#a40ada9b4cf916d4c22ec8c0a8536b3d3">mesos::internal::slave::DockerContainerizer::pruneImages</a></div><div class="ttdeci">virtual process::Future< Nothing > pruneImages(const std::vector< Image > &excludedImages)</div></div> <div class="ttc" id="classmesos_1_1internal_1_1slave_1_1DockerContainerizer_html_ae4acf3fad0a189161329d3fefcd5b1f0"><div class="ttname"><a href="classmesos_1_1internal_1_1slave_1_1DockerContainerizer.html#ae4acf3fad0a189161329d3fefcd5b1f0">mesos::internal::slave::DockerContainerizer::create</a></div><div class="ttdeci">static Try< DockerContainerizer * > create(const Flags &flags, Fetcher *fetcher, const Option< NvidiaComponents > &nvidia=None())</div></div> <div class="ttc" id="classprocess_1_1Future_html"><div class="ttname"><a href="classprocess_1_1Future.html">process::Future< Nothing ></a></div></div> http://git-wip-us.apache.org/repos/asf/mesos-site/blob/2306ff3e/content/api/latest/c++/slave_2containerizer_2mesos_2provisioner_2docker_2paths_8hpp_source.html ---------------------------------------------------------------------- diff --git a/content/api/latest/c++/slave_2containerizer_2mesos_2provisioner_2docker_2paths_8hpp_source.html b/content/api/latest/c++/slave_2containerizer_2mesos_2provisioner_2docker_2paths_8hpp_source.html index b38a0c3..b384941 100644 --- a/content/api/latest/c++/slave_2containerizer_2mesos_2provisioner_2docker_2paths_8hpp_source.html +++ b/content/api/latest/c++/slave_2containerizer_2mesos_2provisioner_2docker_2paths_8hpp_source.html @@ -162,7 +162,7 @@ <div class="ttc" id="namespacemesos_1_1internal_1_1slave_1_1docker_1_1paths_html_a22cde40bae83f8e696ed6eeedc2fd5a4"><div class="ttname"><a href="namespacemesos_1_1internal_1_1slave_1_1docker_1_1paths.html#a22cde40bae83f8e696ed6eeedc2fd5a4">mesos::internal::slave::docker::paths::getGcDir</a></div><div class="ttdeci">std::string getGcDir(const std::string &storeDir)</div></div> <div class="ttc" id="try_8hpp_html"><div class="ttname"><a href="try_8hpp.html">try.hpp</a></div></div> <div class="ttc" id="namespacemesos_1_1internal_1_1slave_1_1docker_1_1paths_html_aa77ccb0998796b4f33392fa61ed69220"><div class="ttname"><a href="namespacemesos_1_1internal_1_1slave_1_1docker_1_1paths.html#aa77ccb0998796b4f33392fa61ed69220">mesos::internal::slave::docker::paths::getImageLayerManifestPath</a></div><div class="ttdeci">std::string getImageLayerManifestPath(const std::string &layerPath)</div></div> -<div class="ttc" id="namespaceos_1_1Shell_html_acfe16ef2b1146ad49a8651c0a457ce46"><div class="ttname"><a href="namespaceos_1_1Shell.html#acfe16ef2b1146ad49a8651c0a457ce46">os::Shell::name</a></div><div class="ttdeci">constexpr const char * name</div><div class="ttdef"><b>Definition:</b> shell.hpp:41</div></div> +<div class="ttc" id="namespaceos_1_1Shell_html_acfe16ef2b1146ad49a8651c0a457ce46"><div class="ttname"><a href="namespaceos_1_1Shell.html#acfe16ef2b1146ad49a8651c0a457ce46">os::Shell::name</a></div><div class="ttdeci">constexpr const char * name</div><div class="ttdef"><b>Definition:</b> shell.hpp:43</div></div> </div><!-- fragment --></div><!-- contents --> <!-- start footer part --> <hr class="footer"/><address class="footer"><small> http://git-wip-us.apache.org/repos/asf/mesos-site/blob/2306ff3e/content/api/latest/c++/slave_8hpp_source.html ---------------------------------------------------------------------- diff --git a/content/api/latest/c++/slave_8hpp_source.html b/content/api/latest/c++/slave_8hpp_source.html index a085294..65ccfe8 100644 --- a/content/api/latest/c++/slave_8hpp_source.html +++ b/content/api/latest/c++/slave_8hpp_source.html @@ -1529,7 +1529,7 @@ <div class="ttc" id="classmesos_1_1internal_1_1slave_1_1Slave_html_a908f4faf4a455a57bb0c12f67c5b352b"><div class="ttname"><a href="classmesos_1_1internal_1_1slave_1_1Slave.html#a908f4faf4a455a57bb0c12f67c5b352b">mesos::internal::slave::Slave::updateFramework</a></div><div class="ttdeci">void updateFramework(const UpdateFrameworkMessage &message)</div></div> <div class="ttc" id="libprocess_2include_2process_2process_8hpp_html"><div class="ttname"><a href="libprocess_2include_2process_2process_8hpp.html">process.hpp</a></div></div> <div class="ttc" id="classmesos_1_1internal_1_1slave_1_1Executor_html_abd7e32a67b2bf5409c1ab855f3220625"><div class="ttname"><a href="classmesos_1_1internal_1_1slave_1_1Executor.html#abd7e32a67b2bf5409c1ab855f3220625">mesos::internal::slave::Executor::terminatedTasks</a></div><div class="ttdeci">LinkedHashMap< TaskID, Task * > terminatedTasks</div><div class="ttdef"><b>Definition:</b> slave.hpp:1029</div></div> -<div class="ttc" id="namespaceos_1_1Shell_html_acfe16ef2b1146ad49a8651c0a457ce46"><div class="ttname"><a href="namespaceos_1_1Shell.html#acfe16ef2b1146ad49a8651c0a457ce46">os::Shell::name</a></div><div class="ttdeci">constexpr const char * name</div><div class="ttdef"><b>Definition:</b> shell.hpp:41</div></div> +<div class="ttc" id="namespaceos_1_1Shell_html_acfe16ef2b1146ad49a8651c0a457ce46"><div class="ttname"><a href="namespaceos_1_1Shell.html#acfe16ef2b1146ad49a8651c0a457ce46">os::Shell::name</a></div><div class="ttdeci">constexpr const char * name</div><div class="ttdef"><b>Definition:</b> shell.hpp:43</div></div> <div class="ttc" id="classmesos_1_1internal_1_1slave_1_1Executor_html_aab395584ca0bd5c7867e093597e6ab09"><div class="ttname"><a href="classmesos_1_1internal_1_1slave_1_1Executor.html#aab395584ca0bd5c7867e093597e6ab09">mesos::internal::slave::Executor::allocatedResources</a></div><div class="ttdeci">Resources allocatedResources() const </div></div> <div class="ttc" id="files_8hpp_html"><div class="ttname"><a href="files_8hpp.html">files.hpp</a></div></div> <div class="ttc" id="classmesos_1_1internal_1_1slave_1_1Framework_html_af3e51bb9c1d72d282695d8a4a9b2e072"><div class="ttname"><a href="classmesos_1_1internal_1_1slave_1_1Framework.html#af3e51bb9c1d72d282695d8a4a9b2e072">mesos::internal::slave::Framework::addPendingTaskGroup</a></div><div class="ttdeci">void addPendingTaskGroup(const ExecutorID &executorId, const TaskGroupInfo &taskGroup)</div></div> http://git-wip-us.apache.org/repos/asf/mesos-site/blob/2306ff3e/content/api/latest/c++/src_2examples_2utils_8hpp_source.html ---------------------------------------------------------------------- diff --git a/content/api/latest/c++/src_2examples_2utils_8hpp_source.html b/content/api/latest/c++/src_2examples_2utils_8hpp_source.html index 9ddb068..0c1e96f 100644 --- a/content/api/latest/c++/src_2examples_2utils_8hpp_source.html +++ b/content/api/latest/c++/src_2examples_2utils_8hpp_source.html @@ -97,7 +97,7 @@ <div class="line"><a name="l00043"></a><span class="lineno"> 43</span> <span class="preprocessor">#endif // __EXAMPLES_UTILS_HPP__</span></div> <div class="ttc" id="namespacemesos_html_ae118ab1966ef7d7b02ca07fd9a785ae6"><div class="ttname"><a href="namespacemesos.html#ae118ab1966ef7d7b02ca07fd9a785ae6">mesos::getScalarResource</a></div><div class="ttdeci">double getScalarResource(const Offer &offer, const std::string &name)</div><div class="ttdef"><b>Definition:</b> utils.hpp:26</div></div> <div class="ttc" id="include_2mesos_2mesos_8hpp_html"><div class="ttname"><a href="include_2mesos_2mesos_8hpp.html">mesos.hpp</a></div></div> -<div class="ttc" id="namespaceos_1_1Shell_html_acfe16ef2b1146ad49a8651c0a457ce46"><div class="ttname"><a href="namespaceos_1_1Shell.html#acfe16ef2b1146ad49a8651c0a457ce46">os::Shell::name</a></div><div class="ttdeci">constexpr const char * name</div><div class="ttdef"><b>Definition:</b> shell.hpp:41</div></div> +<div class="ttc" id="namespaceos_1_1Shell_html_acfe16ef2b1146ad49a8651c0a457ce46"><div class="ttname"><a href="namespaceos_1_1Shell.html#acfe16ef2b1146ad49a8651c0a457ce46">os::Shell::name</a></div><div class="ttdeci">constexpr const char * name</div><div class="ttdef"><b>Definition:</b> shell.hpp:43</div></div> </div><!-- fragment --></div><!-- contents --> <!-- start footer part --> <hr class="footer"/><address class="footer"><small>