1<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> 2<html> 3<head> 4<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> 5<title>Class child</title> 6<link rel="stylesheet" href="../../../../doc/src/boostbook.css" type="text/css"> 7<meta name="generator" content="DocBook XSL Stylesheets V1.79.1"> 8<link rel="home" href="../../index.html" title="The Boost C++ Libraries BoostBook Documentation Subset"> 9<link rel="up" href="../../process/reference.html#header.boost.process.child_hpp" title="Header <boost/process/child.hpp>"> 10<link rel="prev" href="async_system.html" title="Function template async_system"> 11<link rel="next" href="cmd.html" title="Global cmd"> 12</head> 13<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"> 14<table cellpadding="2" width="100%"><tr> 15<td valign="top"><img alt="Boost C++ Libraries" width="277" height="86" src="../../../../boost.png"></td> 16<td align="center"><a href="../../../../index.html">Home</a></td> 17<td align="center"><a href="../../../../libs/libraries.htm">Libraries</a></td> 18<td align="center"><a href="http://www.boost.org/users/people.html">People</a></td> 19<td align="center"><a href="http://www.boost.org/users/faq.html">FAQ</a></td> 20<td align="center"><a href="../../../../more/index.htm">More</a></td> 21</tr></table> 22<hr> 23<div class="spirit-nav"> 24<a accesskey="p" href="async_system.html"><img src="../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../../process/reference.html#header.boost.process.child_hpp"><img src="../../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="../../index.html"><img src="../../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="cmd.html"><img src="../../../../doc/src/images/next.png" alt="Next"></a> 25</div> 26<div class="refentry"> 27<a name="boost.process.child"></a><div class="titlepage"></div> 28<div class="refnamediv"> 29<h2><span class="refentrytitle">Class child</span></h2> 30<p>boost::process::child</p> 31</div> 32<h2 xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv-title">Synopsis</h2> 33<div xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv"><pre class="synopsis"><span class="comment">// In header: <<a class="link" href="../../process/reference.html#header.boost.process.child_hpp" title="Header <boost/process/child.hpp>">boost/process/child.hpp</a>> 34 35</span> 36<span class="keyword">class</span> <a class="link" href="child.html" title="Class child">child</a> <span class="special">{</span> 37<span class="keyword">public</span><span class="special">:</span> 38 <span class="comment">// <a class="link" href="child.html#boost.process.childconstruct-copy-destruct">construct/copy/destruct</a></span> 39 <span class="keyword">explicit</span> <a class="link" href="child.html#idm45243675111488-bb"><span class="identifier">child</span></a><span class="special">(</span><span class="identifier">pid_t</span> <span class="special">&</span><span class="special">)</span><span class="special">;</span> 40 <a class="link" href="child.html#idm45243675109088-bb"><span class="identifier">child</span></a><span class="special">(</span><a class="link" href="child.html" title="Class child">child</a> <span class="special">&&</span><span class="special">)</span><span class="special">;</span> 41 <span class="keyword">template</span><span class="special"><</span><span class="keyword">typename</span> <span class="special">...</span> Args<span class="special">></span> <span class="keyword">explicit</span> <a class="link" href="child.html#idm45243675107568-bb"><span class="identifier">child</span></a><span class="special">(</span><span class="identifier">Args</span> <span class="special">&&</span><span class="special">...</span><span class="special">)</span><span class="special">;</span> 42 <a class="link" href="child.html#idm45243675104912-bb"><span class="identifier">child</span></a><span class="special">(</span><span class="special">)</span> <span class="special">=</span> <span class="keyword">default</span><span class="special">;</span> 43 <a class="link" href="child.html" title="Class child">child</a> <span class="special">&</span> <a class="link" href="child.html#idm45243675104032-bb"><span class="keyword">operator</span><span class="special">=</span></a><span class="special">(</span><a class="link" href="child.html" title="Class child">child</a> <span class="special">&&</span><span class="special">)</span><span class="special">;</span> 44 <a class="link" href="child.html#idm45243675102000-bb"><span class="special">~</span><span class="identifier">child</span></a><span class="special">(</span><span class="special">)</span><span class="special">;</span> 45 46 <span class="comment">// <a class="link" href="child.html#idm45243675153328-bb">private member functions</a></span> 47 <span class="keyword">void</span> <a class="link" href="child.html#idm45243675152832-bb"><span class="identifier">detach</span></a><span class="special">(</span><span class="special">)</span><span class="special">;</span> 48 <span class="keyword">void</span> <a class="link" href="child.html#idm45243675151616-bb"><span class="identifier">join</span></a><span class="special">(</span><span class="special">)</span><span class="special">;</span> 49 <span class="keyword">bool</span> <a class="link" href="child.html#idm45243675150368-bb"><span class="identifier">joinable</span></a><span class="special">(</span><span class="special">)</span><span class="special">;</span> 50 <span class="identifier">native_handle_t</span> <a class="link" href="child.html#idm45243675149232-bb"><span class="identifier">native_handle</span></a><span class="special">(</span><span class="special">)</span> <span class="keyword">const</span><span class="special">;</span> 51 <span class="keyword">int</span> <a class="link" href="child.html#idm45243675147856-bb"><span class="identifier">exit_code</span></a><span class="special">(</span><span class="special">)</span> <span class="keyword">const</span><span class="special">;</span> 52 <span class="identifier">pid_t</span> <a class="link" href="child.html#idm45243675146352-bb"><span class="identifier">id</span></a><span class="special">(</span><span class="special">)</span> <span class="keyword">const</span><span class="special">;</span> 53 <span class="keyword">int</span> <a class="link" href="child.html#idm45243675144976-bb"><span class="identifier">native_exit_code</span></a><span class="special">(</span><span class="special">)</span> <span class="keyword">const</span><span class="special">;</span> 54 <span class="keyword">bool</span> <a class="link" href="child.html#idm45243675143440-bb"><span class="identifier">running</span></a><span class="special">(</span><span class="special">)</span><span class="special">;</span> 55 <span class="keyword">bool</span> <a class="link" href="child.html#idm45243675142304-bb"><span class="identifier">running</span></a><span class="special">(</span><span class="identifier">std</span><span class="special">::</span><span class="identifier">error_code</span> <span class="special">&</span><span class="special">)</span> <span class="keyword">noexcept</span><span class="special">;</span> 56 <span class="keyword">void</span> <a class="link" href="child.html#idm45243675140144-bb"><span class="identifier">wait</span></a><span class="special">(</span><span class="special">)</span><span class="special">;</span> 57 <span class="keyword">void</span> <a class="link" href="child.html#idm45243675139008-bb"><span class="identifier">wait</span></a><span class="special">(</span><span class="identifier">std</span><span class="special">::</span><span class="identifier">error_code</span> <span class="special">&</span><span class="special">)</span> <span class="keyword">noexcept</span><span class="special">;</span> 58 <span class="keyword">template</span><span class="special"><</span><span class="keyword">typename</span> Rep<span class="special">,</span> <span class="keyword">typename</span> Period<span class="special">></span> 59 <span class="keyword">bool</span> <a class="link" href="child.html#idm45243675136848-bb"><span class="identifier">wait_for</span></a><span class="special">(</span><span class="keyword">const</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">chrono</span><span class="special">::</span><span class="identifier">duration</span><span class="special"><</span> <span class="identifier">Rep</span><span class="special">,</span> <span class="identifier">Period</span> <span class="special">></span> <span class="special">&</span><span class="special">)</span><span class="special">;</span> 60 <span class="keyword">bool</span> <a class="link" href="child.html#idm45243675133248-bb"><span class="identifier">wait_for</span></a><span class="special">(</span><span class="keyword">const</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">chrono</span><span class="special">::</span><span class="identifier">duration</span><span class="special"><</span> <span class="identifier">Rep</span><span class="special">,</span> <span class="identifier">Period</span> <span class="special">></span> <span class="special">&</span><span class="special">,</span> 61 <span class="identifier">std</span><span class="special">::</span><span class="identifier">error_code</span> <span class="special">&</span><span class="special">)</span> <span class="keyword">noexcept</span><span class="special">;</span> 62 <span class="keyword">template</span><span class="special"><</span><span class="keyword">typename</span> Clock<span class="special">,</span> <span class="keyword">typename</span> Duration<span class="special">></span> 63 <span class="keyword">bool</span> <a class="link" href="child.html#idm45243675130464-bb"><span class="identifier">wait_until</span></a><span class="special">(</span><span class="keyword">const</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">chrono</span><span class="special">::</span><span class="identifier">time_point</span><span class="special"><</span> <span class="identifier">Clock</span><span class="special">,</span> <span class="identifier">Duration</span> <span class="special">></span> <span class="special">&</span><span class="special">)</span><span class="special">;</span> 64 <span class="keyword">bool</span> <a class="link" href="child.html#idm45243675126864-bb"><span class="identifier">wait_until</span></a><span class="special">(</span><span class="keyword">const</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">chrono</span><span class="special">::</span><span class="identifier">time_point</span><span class="special"><</span> <span class="identifier">Clock</span><span class="special">,</span> <span class="identifier">Duration</span> <span class="special">></span> <span class="special">&</span><span class="special">,</span> 65 <span class="identifier">std</span><span class="special">::</span><span class="identifier">error_code</span> <span class="special">&</span><span class="special">)</span> <span class="keyword">noexcept</span><span class="special">;</span> 66 <span class="keyword">bool</span> <a class="link" href="child.html#idm45243675124080-bb"><span class="identifier">valid</span></a><span class="special">(</span><span class="special">)</span> <span class="keyword">const</span><span class="special">;</span> 67 <span class="keyword">explicit</span> <a class="link" href="child.html#idm45243675121936-bb"><span class="keyword">operator</span> <span class="keyword">bool</span></a><span class="special">(</span><span class="special">)</span> <span class="keyword">const</span><span class="special">;</span> 68 <span class="keyword">bool</span> <a class="link" href="child.html#idm45243675120320-bb"><span class="identifier">in_group</span></a><span class="special">(</span><span class="special">)</span> <span class="keyword">const</span><span class="special">;</span> 69 <span class="keyword">bool</span> <a class="link" href="child.html#idm45243675118864-bb"><span class="identifier">in_group</span></a><span class="special">(</span><span class="identifier">std</span><span class="special">::</span><span class="identifier">error_code</span> <span class="special">&</span><span class="special">)</span> <span class="keyword">const</span> <span class="keyword">noexcept</span><span class="special">;</span> 70 <span class="keyword">void</span> <a class="link" href="child.html#idm45243675116704-bb"><span class="identifier">terminate</span></a><span class="special">(</span><span class="special">)</span><span class="special">;</span> 71 <span class="keyword">void</span> <a class="link" href="child.html#idm45243675113776-bb"><span class="identifier">terminate</span></a><span class="special">(</span><span class="identifier">std</span><span class="special">::</span><span class="identifier">error_code</span> <span class="special">&</span><span class="special">)</span> <span class="keyword">noexcept</span><span class="special">;</span> 72<span class="special">}</span><span class="special">;</span></pre></div> 73<div class="refsect1"> 74<a name="id-1.3.30.9.6.4.4"></a><h2>Description</h2> 75<p>The main class to hold a child process. It is simliar to <a href="http://en.cppreference.com/w/cpp/thread/thread" target="_top">std::thread</a>, in that it has a join and detach function.</p> 76<div class="note"><table border="0" summary="Note"> 77<tr> 78<td rowspan="2" align="center" valign="top" width="25"><img alt="[Note]" src="../../../../doc/src/images/note.png"></td> 79<th align="left">Note</th> 80</tr> 81<tr><td align="left" valign="top"><p>The destructor will call terminate on the process if not joined or detached without any warning. </p></td></tr> 82</table></div> 83<p> 84</p> 85<div class="refsect2"> 86<a name="id-1.3.30.9.6.4.4.4"></a><h3> 87<a name="boost.process.childconstruct-copy-destruct"></a><code class="computeroutput">child</code> 88 public 89 construct/copy/destruct</h3> 90<div class="orderedlist"><ol class="orderedlist" type="1"> 91<li class="listitem"> 92<pre class="literallayout"><span class="keyword">explicit</span> <a name="idm45243675111488-bb"></a><span class="identifier">child</span><span class="special">(</span><span class="identifier">pid_t</span> <span class="special">&</span> pid<span class="special">)</span><span class="special">;</span></pre> 93<p>Construct the child from a pid.</p> 94<div class="note"><table border="0" summary="Note"> 95<tr> 96<td rowspan="2" align="center" valign="top" width="25"><img alt="[Note]" src="../../../../doc/src/images/note.png"></td> 97<th align="left">Note</th> 98</tr> 99<tr><td align="left" valign="top"><p>There is no guarantee that this will work. The process need the right access rights, which are very platform specific. </p></td></tr> 100</table></div> 101<p> 102</p> 103</li> 104<li class="listitem"> 105<pre class="literallayout"><a name="idm45243675109088-bb"></a><span class="identifier">child</span><span class="special">(</span><a class="link" href="child.html" title="Class child">child</a> <span class="special">&&</span> lhs<span class="special">)</span><span class="special">;</span></pre> 106<p>Move-Constructor. </p> 107</li> 108<li class="listitem"> 109<pre class="literallayout"><span class="keyword">template</span><span class="special"><</span><span class="keyword">typename</span> <span class="special">...</span> Args<span class="special">></span> <span class="keyword">explicit</span> <a name="idm45243675107568-bb"></a><span class="identifier">child</span><span class="special">(</span><span class="identifier">Args</span> <span class="special">&&</span><span class="special">...</span> args<span class="special">)</span><span class="special">;</span></pre> 110<p>Construct a child from a property list and launch it The standard version is to create a subprocess, which will spawn the process. </p> 111</li> 112<li class="listitem"> 113<pre class="literallayout"><a name="idm45243675104912-bb"></a><span class="identifier">child</span><span class="special">(</span><span class="special">)</span> <span class="special">=</span> <span class="keyword">default</span><span class="special">;</span></pre> 114<p>Construct an empty child. </p> 115</li> 116<li class="listitem"> 117<pre class="literallayout"><a class="link" href="child.html" title="Class child">child</a> <span class="special">&</span> <a name="idm45243675104032-bb"></a><span class="keyword">operator</span><span class="special">=</span><span class="special">(</span><a class="link" href="child.html" title="Class child">child</a> <span class="special">&&</span> lhs<span class="special">)</span><span class="special">;</span></pre> 118<p>Move assign. </p> 119</li> 120<li class="listitem"> 121<pre class="literallayout"><a name="idm45243675102000-bb"></a><span class="special">~</span><span class="identifier">child</span><span class="special">(</span><span class="special">)</span><span class="special">;</span></pre> 122<p>Destructor. </p> 123<div class="note"><table border="0" summary="Note"> 124<tr> 125<td rowspan="2" align="center" valign="top" width="25"><img alt="[Note]" src="../../../../doc/src/images/note.png"></td> 126<th align="left">Note</th> 127</tr> 128<tr><td align="left" valign="top"><p>Will call terminate (without warning) when the child was neither joined nor detached. </p></td></tr> 129</table></div> 130<p> 131</p> 132</li> 133</ol></div> 134</div> 135<div class="refsect2"> 136<a name="id-1.3.30.9.6.4.4.5"></a><h3> 137<a name="idm45243675153328-bb"></a><code class="computeroutput">child</code> private member functions</h3> 138<div class="orderedlist"><ol class="orderedlist" type="1"> 139<li class="listitem"> 140<pre class="literallayout"><span class="keyword">void</span> <a name="idm45243675152832-bb"></a><span class="identifier">detach</span><span class="special">(</span><span class="special">)</span><span class="special">;</span></pre> 141<p>Detach the child, i.e. let it run after this handle dies. </p> 142</li> 143<li class="listitem"> 144<pre class="literallayout"><span class="keyword">void</span> <a name="idm45243675151616-bb"></a><span class="identifier">join</span><span class="special">(</span><span class="special">)</span><span class="special">;</span></pre> 145<p>Join the child. This just calls wait, but that way the naming is similar to std::thread </p> 146</li> 147<li class="listitem"> 148<pre class="literallayout"><span class="keyword">bool</span> <a name="idm45243675150368-bb"></a><span class="identifier">joinable</span><span class="special">(</span><span class="special">)</span><span class="special">;</span></pre> 149<p>Check if the child is joinable. </p> 150</li> 151<li class="listitem"> 152<pre class="literallayout"><span class="identifier">native_handle_t</span> <a name="idm45243675149232-bb"></a><span class="identifier">native_handle</span><span class="special">(</span><span class="special">)</span> <span class="keyword">const</span><span class="special">;</span></pre> 153<p>Get the native handle for the child process. </p> 154</li> 155<li class="listitem"> 156<pre class="literallayout"><span class="keyword">int</span> <a name="idm45243675147856-bb"></a><span class="identifier">exit_code</span><span class="special">(</span><span class="special">)</span> <span class="keyword">const</span><span class="special">;</span></pre> 157<p>Get the exit_code. The return value is without any meaning if the child wasn't waited for or if it was terminated. </p> 158</li> 159<li class="listitem"> 160<pre class="literallayout"><span class="identifier">pid_t</span> <a name="idm45243675146352-bb"></a><span class="identifier">id</span><span class="special">(</span><span class="special">)</span> <span class="keyword">const</span><span class="special">;</span></pre> 161<p>Get the Process Identifier. </p> 162</li> 163<li class="listitem"> 164<pre class="literallayout"><span class="keyword">int</span> <a name="idm45243675144976-bb"></a><span class="identifier">native_exit_code</span><span class="special">(</span><span class="special">)</span> <span class="keyword">const</span><span class="special">;</span></pre> 165<p>Get the native, uninterpreted exit code. The return value is without any meaning if the child wasn't waited for or if it was terminated. </p> 166</li> 167<li class="listitem"> 168<pre class="literallayout"><span class="keyword">bool</span> <a name="idm45243675143440-bb"></a><span class="identifier">running</span><span class="special">(</span><span class="special">)</span><span class="special">;</span></pre> 169<p>Check if the child process is running. </p> 170</li> 171<li class="listitem"> 172<pre class="literallayout"><span class="keyword">bool</span> <a name="idm45243675142304-bb"></a><span class="identifier">running</span><span class="special">(</span><span class="identifier">std</span><span class="special">::</span><span class="identifier">error_code</span> <span class="special">&</span> ec<span class="special">)</span> <span class="keyword">noexcept</span><span class="special">;</span></pre> 173<p>This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. </p> 174</li> 175<li class="listitem"> 176<pre class="literallayout"><span class="keyword">void</span> <a name="idm45243675140144-bb"></a><span class="identifier">wait</span><span class="special">(</span><span class="special">)</span><span class="special">;</span></pre> 177<p>Wait for the child process to exit. </p> 178</li> 179<li class="listitem"> 180<pre class="literallayout"><span class="keyword">void</span> <a name="idm45243675139008-bb"></a><span class="identifier">wait</span><span class="special">(</span><span class="identifier">std</span><span class="special">::</span><span class="identifier">error_code</span> <span class="special">&</span> ec<span class="special">)</span> <span class="keyword">noexcept</span><span class="special">;</span></pre> 181<p>This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. </p> 182</li> 183<li class="listitem"> 184<pre class="literallayout"><span class="keyword">template</span><span class="special"><</span><span class="keyword">typename</span> Rep<span class="special">,</span> <span class="keyword">typename</span> Period<span class="special">></span> 185 <span class="keyword">bool</span> <a name="idm45243675136848-bb"></a><span class="identifier">wait_for</span><span class="special">(</span><span class="keyword">const</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">chrono</span><span class="special">::</span><span class="identifier">duration</span><span class="special"><</span> <span class="identifier">Rep</span><span class="special">,</span> <span class="identifier">Period</span> <span class="special">></span> <span class="special">&</span> rel_time<span class="special">)</span><span class="special">;</span></pre> 186<p>Wait for the child process to exit for a period of time. 187</p> 188<div class="variablelist"><table border="0" class="variablelist compact"> 189<colgroup> 190<col align="left" valign="top"> 191<col> 192</colgroup> 193<tbody><tr> 194<td><p><span class="term">Returns:</span></p></td> 195<td><p>True if child exited while waiting. </p></td> 196</tr></tbody> 197</table></div> 198</li> 199<li class="listitem"> 200<pre class="literallayout"><span class="keyword">bool</span> <a name="idm45243675133248-bb"></a><span class="identifier">wait_for</span><span class="special">(</span><span class="keyword">const</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">chrono</span><span class="special">::</span><span class="identifier">duration</span><span class="special"><</span> <span class="identifier">Rep</span><span class="special">,</span> <span class="identifier">Period</span> <span class="special">></span> <span class="special">&</span> rel_time<span class="special">,</span> 201 <span class="identifier">std</span><span class="special">::</span><span class="identifier">error_code</span> <span class="special">&</span> ec<span class="special">)</span> <span class="keyword">noexcept</span><span class="special">;</span></pre> 202<p>This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. </p> 203</li> 204<li class="listitem"> 205<pre class="literallayout"><span class="keyword">template</span><span class="special"><</span><span class="keyword">typename</span> Clock<span class="special">,</span> <span class="keyword">typename</span> Duration<span class="special">></span> 206 <span class="keyword">bool</span> <a name="idm45243675130464-bb"></a><span class="identifier">wait_until</span><span class="special">(</span><span class="keyword">const</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">chrono</span><span class="special">::</span><span class="identifier">time_point</span><span class="special"><</span> <span class="identifier">Clock</span><span class="special">,</span> <span class="identifier">Duration</span> <span class="special">></span> <span class="special">&</span> timeout_time<span class="special">)</span><span class="special">;</span></pre> 207<p>Wait for the child process to exit until a point in time. 208</p> 209<div class="variablelist"><table border="0" class="variablelist compact"> 210<colgroup> 211<col align="left" valign="top"> 212<col> 213</colgroup> 214<tbody><tr> 215<td><p><span class="term">Returns:</span></p></td> 216<td><p>True if child exited while waiting. </p></td> 217</tr></tbody> 218</table></div> 219</li> 220<li class="listitem"> 221<pre class="literallayout"><span class="keyword">bool</span> <a name="idm45243675126864-bb"></a><span class="identifier">wait_until</span><span class="special">(</span><span class="keyword">const</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">chrono</span><span class="special">::</span><span class="identifier">time_point</span><span class="special"><</span> <span class="identifier">Clock</span><span class="special">,</span> <span class="identifier">Duration</span> <span class="special">></span> <span class="special">&</span> timeout_time<span class="special">,</span> 222 <span class="identifier">std</span><span class="special">::</span><span class="identifier">error_code</span> <span class="special">&</span> ec<span class="special">)</span> <span class="keyword">noexcept</span><span class="special">;</span></pre> 223<p>This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. </p> 224</li> 225<li class="listitem"> 226<pre class="literallayout"><span class="keyword">bool</span> <a name="idm45243675124080-bb"></a><span class="identifier">valid</span><span class="special">(</span><span class="special">)</span> <span class="keyword">const</span><span class="special">;</span></pre> 227<p>Check if this handle holds a child process. </p> 228<div class="note"><table border="0" summary="Note"> 229<tr> 230<td rowspan="2" align="center" valign="top" width="25"><img alt="[Note]" src="../../../../doc/src/images/note.png"></td> 231<th align="left">Note</th> 232</tr> 233<tr><td align="left" valign="top"><p>That does not mean, that the process is still running. It only means, that the handle does or did exist. </p></td></tr> 234</table></div> 235<p> 236</p> 237</li> 238<li class="listitem"> 239<pre class="literallayout"><span class="keyword">explicit</span> <a name="idm45243675121936-bb"></a><span class="keyword">operator</span> <span class="keyword">bool</span><span class="special">(</span><span class="special">)</span> <span class="keyword">const</span><span class="special">;</span></pre> 240<p>Same as valid, for convenience. </p> 241</li> 242<li class="listitem"> 243<pre class="literallayout"><span class="keyword">bool</span> <a name="idm45243675120320-bb"></a><span class="identifier">in_group</span><span class="special">(</span><span class="special">)</span> <span class="keyword">const</span><span class="special">;</span></pre> 244<p>Check if the the chlid process is in any process group. </p> 245</li> 246<li class="listitem"> 247<pre class="literallayout"><span class="keyword">bool</span> <a name="idm45243675118864-bb"></a><span class="identifier">in_group</span><span class="special">(</span><span class="identifier">std</span><span class="special">::</span><span class="identifier">error_code</span> <span class="special">&</span> ec<span class="special">)</span> <span class="keyword">const</span> <span class="keyword">noexcept</span><span class="special">;</span></pre> 248<p>This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. </p> 249</li> 250<li class="listitem"> 251<pre class="literallayout"><span class="keyword">void</span> <a name="idm45243675116704-bb"></a><span class="identifier">terminate</span><span class="special">(</span><span class="special">)</span><span class="special">;</span></pre> 252<p>Terminate the child process.</p> 253<p>This function will cause the child process to unconditionally and immediately exit. It is implement with <a href="http://pubs.opengroup.org/onlinepubs/009695399/functions/kill.html" target="_top">SIGKILL</a> on posix and <a href="https://technet.microsoft.com/en-us/library/ms686714.aspx" target="_top">TerminateProcess</a> on windows. </p> 254</li> 255<li class="listitem"> 256<pre class="literallayout"><span class="keyword">void</span> <a name="idm45243675113776-bb"></a><span class="identifier">terminate</span><span class="special">(</span><span class="identifier">std</span><span class="special">::</span><span class="identifier">error_code</span> <span class="special">&</span> ec<span class="special">)</span> <span class="keyword">noexcept</span><span class="special">;</span></pre> 257<p>This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. </p> 258</li> 259</ol></div> 260</div> 261</div> 262</div> 263<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr> 264<td align="left"></td> 265<td align="right"><div class="copyright-footer">Copyright © 2006-2012 Julio M. Merino Vidal, Ilya Sokolov, 266 Felipe Tanus, Jeff Flinn, Boris Schaeling<br>Copyright © 2016 Klemens D. Morgenstern<p> 267 Distributed under the Boost Software License, Version 1.0. (See accompanying 268 file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) 269 </p> 270</div></td> 271</tr></table> 272<hr> 273<div class="spirit-nav"> 274<a accesskey="p" href="async_system.html"><img src="../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../../process/reference.html#header.boost.process.child_hpp"><img src="../../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="../../index.html"><img src="../../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="cmd.html"><img src="../../../../doc/src/images/next.png" alt="Next"></a> 275</div> 276</body> 277</html> 278