/usr/share/doc/racket/inside/Subprocesses.html is in racket-doc 6.1-4.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 | <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html><head><meta http-equiv="content-type" content="text/html; charset=utf-8"/><title>19 Subprocesses</title><link rel="stylesheet" type="text/css" href="../scribble.css" title="default"/><link rel="stylesheet" type="text/css" href="../racket.css" title="default"/><link rel="stylesheet" type="text/css" href="../manual-style.css" title="default"/><link rel="stylesheet" type="text/css" href="../manual-racket.css" title="default"/><link rel="stylesheet" type="text/css" href="../doc-site.css" title="default"/><script type="text/javascript" src="../scribble-common.js"></script><script type="text/javascript" src="../manual-racket.js"></script><script type="text/javascript" src="../doc-site.js"></script><script type="text/javascript" src="../local-redirect/local-redirect.js"></script><script type="text/javascript" src="../local-redirect/local-user-redirect.js"></script><!--[if IE 6]><style type="text/css">.SIEHidden { overflow: hidden; }</style><![endif]--></head><body id="doc-racket-lang-org"><div class="tocset"><div class="tocview"><div class="tocviewlist tocviewlisttopspace"><div class="tocviewtitle"><table cellspacing="0" cellpadding="0"><tr><td style="width: 1em;"><a href="javascript:void(0);" title="Expand/Collapse" class="tocviewtoggle" onclick="TocviewToggle(this,"tocview_0");">▼</a></td><td></td><td><a href="index.html" class="tocviewlink" data-pltdoc="x">Inside:<span class="mywbr"> </span> Racket C API</a></td></tr></table></div><div class="tocviewsublistonly" style="display: block;" id="tocview_0"><table cellspacing="0" cellpadding="0"><tr><td align="right">1 </td><td><a href="overview.html" class="tocviewlink" data-pltdoc="x">Overview</a></td></tr><tr><td align="right">2 </td><td><a href="embedding.html" class="tocviewlink" data-pltdoc="x">Embedding into a Program</a></td></tr><tr><td align="right">3 </td><td><a href="Writing_Racket_Extensions.html" class="tocviewlink" data-pltdoc="x">Writing Racket Extensions</a></td></tr><tr><td align="right">4 </td><td><a href="im_values_types.html" class="tocviewlink" data-pltdoc="x">Values and Types</a></td></tr><tr><td align="right">5 </td><td><a href="im_memoryalloc.html" class="tocviewlink" data-pltdoc="x">Memory Allocation</a></td></tr><tr><td align="right">6 </td><td><a href="im_env.html" class="tocviewlink" data-pltdoc="x">Namespaces and Modules</a></td></tr><tr><td align="right">7 </td><td><a href="Procedures.html" class="tocviewlink" data-pltdoc="x">Procedures</a></td></tr><tr><td align="right">8 </td><td><a href="Evaluation.html" class="tocviewlink" data-pltdoc="x">Evaluation</a></td></tr><tr><td align="right">9 </td><td><a href="exceptions.html" class="tocviewlink" data-pltdoc="x">Exceptions and Escape Continuations</a></td></tr><tr><td align="right">10 </td><td><a href="threads.html" class="tocviewlink" data-pltdoc="x">Threads</a></td></tr><tr><td align="right">11 </td><td><a href="config.html" class="tocviewlink" data-pltdoc="x">Parameterizations</a></td></tr><tr><td align="right">12 </td><td><a href="contmarks.html" class="tocviewlink" data-pltdoc="x">Continuation Marks</a></td></tr><tr><td align="right">13 </td><td><a href="im_encodings.html" class="tocviewlink" data-pltdoc="x">String Encodings</a></td></tr><tr><td align="right">14 </td><td><a href="Bignums__Rationals__and_Complex_Numbers.html" class="tocviewlink" data-pltdoc="x">Bignums, Rationals, and Complex Numbers</a></td></tr><tr><td align="right">15 </td><td><a href="Ports_and_the_Filesystem.html" class="tocviewlink" data-pltdoc="x">Ports and the Filesystem</a></td></tr><tr><td align="right">16 </td><td><a href="Structures.html" class="tocviewlink" data-pltdoc="x">Structures</a></td></tr><tr><td align="right">17 </td><td><a href="security.html" class="tocviewlink" data-pltdoc="x">Security Guards</a></td></tr><tr><td align="right">18 </td><td><a href="Custodians.html" class="tocviewlink" data-pltdoc="x">Custodians</a></td></tr><tr><td align="right">19 </td><td><a href="" class="tocviewselflink" data-pltdoc="x">Subprocesses</a></td></tr><tr><td align="right">20 </td><td><a href="Miscellaneous_Utilities.html" class="tocviewlink" data-pltdoc="x">Miscellaneous Utilities</a></td></tr><tr><td align="right"></td><td><a href="doc-index.html" class="tocviewlink" data-pltdoc="x">Index</a></td></tr></table></div></div></div></div><div class="maincolumn"><div class="main"><div class="navsettop"><span class="navleft"><form class="searchform"><input class="searchbox" style="color: #888;" type="text" value="...search manuals..." title="Enter a search string to search the manuals" onkeypress="return DoSearchKey(event, this, "6.1", "../");" onfocus="this.style.color="black"; this.style.textAlign="left"; if (this.value == "...search manuals...") this.value="";" onblur="if (this.value.match(/^ *$/)) { this.style.color="#888"; this.style.textAlign="center"; this.value="...search manuals..."; }"/></form> <a href="../index.html" title="up to the documentation top" data-pltdoc="x" onclick="return GotoPLTRoot("6.1");">top</a></span><span class="navright"> <a href="Custodians.html" title="backward to "18 Custodians"" data-pltdoc="x">← prev</a> <a href="index.html" title="up to "Inside: Racket C API"" data-pltdoc="x">up</a> <a href="Miscellaneous_Utilities.html" title="forward to "20 Miscellaneous Utilities"" data-pltdoc="x">next →</a></span> </div><h3 x-source-module="(lib "scribblings/inside/inside.scrbl")" x-part-tag=""Subprocesses"">19<tt> </tt><a name="(part._.Subprocesses)"></a>Subprocesses</h3><p>On Unix and Mac OS X, subprocess handling involves
<a name="(idx._(gentag._559._(lib._scribblings/inside/inside..scrbl)))"></a><span class="stt">fork</span>, <a name="(idx._(gentag._560._(lib._scribblings/inside/inside..scrbl)))"></a><span class="stt">waitpid</span>, and
<a name="(idx._(gentag._561._(lib._scribblings/inside/inside..scrbl)))"></a><span class="stt">SIGCHLD</span>, which creates a variety of issues within an
embedding application. On Windows, subprocess handling is more
straightforward, since no <span class="stt">fork</span> is required, and since Windows
provides an abstraction that is a close fit to Racket’s subprocess
values.</p><p>After Racket creates a subprocess via <span class="RktSym"><a href="http://download.racket-lang.org/docs/6.1/html/local-redirect/index.html?doc=reference&rel=subprocess.html%23%2528def._%2528%2528quote._%7E23%7E25kernel%2529._subprocess%2529%2529&version=6.1" class="RktValLink Sq" data-pltdoc="x">subprocess</a></span> (or
<span class="RktSym"><a href="http://download.racket-lang.org/docs/6.1/html/local-redirect/index.html?doc=reference&rel=subprocess.html%23%2528def._%2528%2528lib._racket%252Fsystem..rkt%2529._system%2529%2529&version=6.1" class="RktValLink Sq" data-pltdoc="x">system</a></span>, <span class="RktSym"><a href="http://download.racket-lang.org/docs/6.1/html/local-redirect/index.html?doc=reference&rel=subprocess.html%23%2528def._%2528%2528lib._racket%252Fsystem..rkt%2529._process%2529%2529&version=6.1" class="RktValLink Sq" data-pltdoc="x">process</a></span>, etc.), it periodically polls the
process status using <span class="stt">waitpid</span>. If the process is created as its
own group, then the call to <span class="stt">waitpid</span> uses the created
subprocess’s process ID; for all other subprocesses, polling uses a
single call to <span class="stt">waitpid</span> with the first argument as <span class="stt">0</span>. Using
<span class="stt">0</span>, in particular, can interfere with other libraries in an
embedding context, so Racket refrains from calling <span class="stt">waitpid</span> if no
subprocesses are pending.</p><p>Racket may or may not rely on a <span class="stt">SIGCHLD</span> handler, and it may or
may not block <span class="stt">SIGCHLD</span>. Currently, when Racket is compiled to
support <a href="http://download.racket-lang.org/docs/6.1/html/local-redirect/index.html?doc=reference&rel=places.html%23%2528tech._place%2529&version=6.1" class="techoutside Sq" data-pltdoc="x"><span class="techinside">place</span></a>s, Racket blocks <span class="stt">SIGCHLD</span> on start up with
the expectation that all created threads have <span class="stt">SIGCHLD</span> blocked.
When Racket is not compiled to support <a href="http://download.racket-lang.org/docs/6.1/html/local-redirect/index.html?doc=reference&rel=places.html%23%2528tech._place%2529&version=6.1" class="techoutside Sq" data-pltdoc="x"><span class="techinside">place</span></a>s, then a
<span class="stt">SIGCHLD</span> handler is installed.</p><p>Using <span class="stt">fork</span> in an application that embeds Racket is problematic
for several reasons: Racket may install a <span class="stt">SIGALRM</span> handler and
schedule alarms to implement context switches, it may have file
descriptors open that should be closed in a child process, and it may
have changed the disposition of signals such as
<span class="stt">SIGCHLD</span>. Consequently, embedding Racket in a process that
<span class="stt">fork</span>s is technically not supported; in the future, Racket may
provide better support for such applications.</p><div class="navsetbottom"><span class="navleft"><form class="searchform"><input class="searchbox" style="color: #888;" type="text" value="...search manuals..." title="Enter a search string to search the manuals" onkeypress="return DoSearchKey(event, this, "6.1", "../");" onfocus="this.style.color="black"; this.style.textAlign="left"; if (this.value == "...search manuals...") this.value="";" onblur="if (this.value.match(/^ *$/)) { this.style.color="#888"; this.style.textAlign="center"; this.value="...search manuals..."; }"/></form> <a href="../index.html" title="up to the documentation top" data-pltdoc="x" onclick="return GotoPLTRoot("6.1");">top</a></span><span class="navright"> <a href="Custodians.html" title="backward to "18 Custodians"" data-pltdoc="x">← prev</a> <a href="index.html" title="up to "Inside: Racket C API"" data-pltdoc="x">up</a> <a href="Miscellaneous_Utilities.html" title="forward to "20 Miscellaneous Utilities"" data-pltdoc="x">next →</a></span> </div></div></div><div id="contextindicator"> </div></body></html>
|