Sophie

Sophie

distrib > Mandriva > current > i586 > media > main-updates > by-pkgid > e0236b39c613e86bcee76bad717809a5 > files > 141

libapr-devel-1.4.6-0.1mdv2010.2.i586.rpm

<!-- This comment will put IE 6, 7 and 8 in quirks mode -->
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<title>Apache Portable Runtime: apr_thread_proc.h Source File</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javaScript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css"/>
</head>
<body onload='searchBox.OnSelectItem(0);'>
<!-- Generated by Doxygen 1.6.3 -->
<script type="text/javascript"><!--
var searchBox = new SearchBox("searchBox", "search",false,'Search');
--></script>
<div class="navigation" id="top">
  <div class="tabs">
    <ul>
      <li><a href="index.html"><span>Main&nbsp;Page</span></a></li>
      <li><a href="pages.html"><span>Related&nbsp;Pages</span></a></li>
      <li><a href="modules.html"><span>Modules</span></a></li>
      <li><a href="annotated.html"><span>Data&nbsp;Structures</span></a></li>
      <li class="current"><a href="files.html"><span>Files</span></a></li>
      <li>
        <div id="MSearchBox" class="MSearchBoxInactive">
        <img id="MSearchSelect" src="search/search.png"
             onmouseover="return searchBox.OnSearchSelectShow()"
             onmouseout="return searchBox.OnSearchSelectHide()"
             alt=""/>
        <input type="text" id="MSearchField" value="Search" accesskey="S"
             onfocus="searchBox.OnSearchFieldFocus(true)" 
             onblur="searchBox.OnSearchFieldFocus(false)" 
             onkeyup="searchBox.OnSearchFieldChange(event)"/>
        <a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a>
        </div>
      </li>
    </ul>
  </div>
  <div class="tabs">
    <ul>
      <li><a href="files.html"><span>File&nbsp;List</span></a></li>
      <li><a href="globals.html"><span>Globals</span></a></li>
    </ul>
  </div>
<h1>apr_thread_proc.h</h1><a href="apr__thread__proc_8h.html">Go to the documentation of this file.</a><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="comment">/* Licensed to the Apache Software Foundation (ASF) under one or more</span>
<a name="l00002"></a>00002 <span class="comment"> * contributor license agreements.  See the NOTICE file distributed with</span>
<a name="l00003"></a>00003 <span class="comment"> * this work for additional information regarding copyright ownership.</span>
<a name="l00004"></a>00004 <span class="comment"> * The ASF licenses this file to You under the Apache License, Version 2.0</span>
<a name="l00005"></a>00005 <span class="comment"> * (the &quot;License&quot;); you may not use this file except in compliance with</span>
<a name="l00006"></a>00006 <span class="comment"> * the License.  You may obtain a copy of the License at</span>
<a name="l00007"></a>00007 <span class="comment"> *</span>
<a name="l00008"></a>00008 <span class="comment"> *     http://www.apache.org/licenses/LICENSE-2.0</span>
<a name="l00009"></a>00009 <span class="comment"> *</span>
<a name="l00010"></a>00010 <span class="comment"> * Unless required by applicable law or agreed to in writing, software</span>
<a name="l00011"></a>00011 <span class="comment"> * distributed under the License is distributed on an &quot;AS IS&quot; BASIS,</span>
<a name="l00012"></a>00012 <span class="comment"> * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.</span>
<a name="l00013"></a>00013 <span class="comment"> * See the License for the specific language governing permissions and</span>
<a name="l00014"></a>00014 <span class="comment"> * limitations under the License.</span>
<a name="l00015"></a>00015 <span class="comment"> */</span>
<a name="l00016"></a>00016 
<a name="l00017"></a>00017 <span class="preprocessor">#ifndef APR_THREAD_PROC_H</span>
<a name="l00018"></a>00018 <span class="preprocessor"></span><span class="preprocessor">#define APR_THREAD_PROC_H</span>
<a name="l00019"></a>00019 <span class="preprocessor"></span><span class="comment"></span>
<a name="l00020"></a>00020 <span class="comment">/**</span>
<a name="l00021"></a>00021 <span class="comment"> * @file apr_thread_proc.h</span>
<a name="l00022"></a>00022 <span class="comment"> * @brief APR Thread and Process Library</span>
<a name="l00023"></a>00023 <span class="comment"> */</span>
<a name="l00024"></a>00024 
<a name="l00025"></a>00025 <span class="preprocessor">#include &quot;<a class="code" href="apr_8h.html" title="APR Platform Definitions.">apr.h</a>&quot;</span>
<a name="l00026"></a>00026 <span class="preprocessor">#include &quot;<a class="code" href="apr__file__io_8h.html" title="APR File I/O Handling.">apr_file_io.h</a>&quot;</span>
<a name="l00027"></a>00027 <span class="preprocessor">#include &quot;<a class="code" href="apr__pools_8h.html" title="APR memory allocation.">apr_pools.h</a>&quot;</span>
<a name="l00028"></a>00028 <span class="preprocessor">#include &quot;<a class="code" href="apr__errno_8h.html" title="APR Error Codes.">apr_errno.h</a>&quot;</span>
<a name="l00029"></a>00029 
<a name="l00030"></a>00030 <span class="preprocessor">#if APR_HAVE_STRUCT_RLIMIT</span>
<a name="l00031"></a>00031 <span class="preprocessor"></span><span class="preprocessor">#include &lt;sys/time.h&gt;</span>
<a name="l00032"></a>00032 <span class="preprocessor">#include &lt;sys/resource.h&gt;</span>
<a name="l00033"></a>00033 <span class="preprocessor">#endif</span>
<a name="l00034"></a>00034 <span class="preprocessor"></span>
<a name="l00035"></a>00035 <span class="preprocessor">#ifdef __cplusplus</span>
<a name="l00036"></a>00036 <span class="preprocessor"></span><span class="keyword">extern</span> <span class="stringliteral">&quot;C&quot;</span> {
<a name="l00037"></a>00037 <span class="preprocessor">#endif </span><span class="comment">/* __cplusplus */</span>
<a name="l00038"></a>00038 <span class="comment"></span>
<a name="l00039"></a>00039 <span class="comment">/**</span>
<a name="l00040"></a>00040 <span class="comment"> * @defgroup apr_thread_proc Threads and Process Functions</span>
<a name="l00041"></a>00041 <span class="comment"> * @ingroup APR </span>
<a name="l00042"></a>00042 <span class="comment"> * @{</span>
<a name="l00043"></a>00043 <span class="comment"> */</span>
<a name="l00044"></a>00044 
<a name="l00045"></a><a class="code" href="group__apr__thread__proc.html#gadcb981d7748c580eb69ac11dbf709060">00045</a> <span class="keyword">typedef</span> <span class="keyword">enum</span> {
<a name="l00046"></a><a class="code" href="group__apr__thread__proc.html#ggadcb981d7748c580eb69ac11dbf709060a02f5d83f79e2c12bfca5a86d7f14caa6">00046</a>     <a class="code" href="group__apr__thread__proc.html#ggadcb981d7748c580eb69ac11dbf709060a02f5d83f79e2c12bfca5a86d7f14caa6">APR_SHELLCMD</a>,           <span class="comment">/**&lt; use the shell to invoke the program */</span>
<a name="l00047"></a><a class="code" href="group__apr__thread__proc.html#ggadcb981d7748c580eb69ac11dbf709060ac128c1239a524cf21300b8ed6248ac99">00047</a>     <a class="code" href="group__apr__thread__proc.html#ggadcb981d7748c580eb69ac11dbf709060ac128c1239a524cf21300b8ed6248ac99">APR_PROGRAM</a>,            <span class="comment">/**&lt; invoke the program directly, no copied env */</span>
<a name="l00048"></a><a class="code" href="group__apr__thread__proc.html#ggadcb981d7748c580eb69ac11dbf709060a6a3f9694aced0e449f6bb4b3e437233a">00048</a>     <a class="code" href="group__apr__thread__proc.html#ggadcb981d7748c580eb69ac11dbf709060a6a3f9694aced0e449f6bb4b3e437233a">APR_PROGRAM_ENV</a>,        <span class="comment">/**&lt; invoke the program, replicating our environment */</span>
<a name="l00049"></a><a class="code" href="group__apr__thread__proc.html#ggadcb981d7748c580eb69ac11dbf709060aa424b51bdc16e4d18bb757a32c6a346a">00049</a>     <a class="code" href="group__apr__thread__proc.html#ggadcb981d7748c580eb69ac11dbf709060aa424b51bdc16e4d18bb757a32c6a346a">APR_PROGRAM_PATH</a>,       <span class="comment">/**&lt; find program on PATH, use our environment */</span>
<a name="l00050"></a><a class="code" href="group__apr__thread__proc.html#ggadcb981d7748c580eb69ac11dbf709060afcefc45317b67fad6dc5459772ce9409">00050</a>     <a class="code" href="group__apr__thread__proc.html#ggadcb981d7748c580eb69ac11dbf709060afcefc45317b67fad6dc5459772ce9409">APR_SHELLCMD_ENV</a>        <span class="comment">/**&lt; use the shell to invoke the program,</span>
<a name="l00051"></a>00051 <span class="comment">                             *   replicating our environment</span>
<a name="l00052"></a>00052 <span class="comment">                             */</span>
<a name="l00053"></a>00053 } <a class="code" href="group__apr__thread__proc.html#gadcb981d7748c580eb69ac11dbf709060">apr_cmdtype_e</a>;
<a name="l00054"></a>00054 
<a name="l00055"></a><a class="code" href="group__apr__thread__proc.html#ga5e52d786644f3b66d6180571e68c7260">00055</a> <span class="keyword">typedef</span> <span class="keyword">enum</span> {
<a name="l00056"></a><a class="code" href="group__apr__thread__proc.html#gga5e52d786644f3b66d6180571e68c7260a057885ccf4b8b707e0d115c691037de4">00056</a>     <a class="code" href="group__apr__thread__proc.html#gga5e52d786644f3b66d6180571e68c7260a057885ccf4b8b707e0d115c691037de4">APR_WAIT</a>,           <span class="comment">/**&lt; wait for the specified process to finish */</span>
<a name="l00057"></a><a class="code" href="group__apr__thread__proc.html#gga5e52d786644f3b66d6180571e68c7260a0163031f6b72b0c4add9108052a672d5">00057</a>     <a class="code" href="group__apr__thread__proc.html#gga5e52d786644f3b66d6180571e68c7260a0163031f6b72b0c4add9108052a672d5">APR_NOWAIT</a>          <span class="comment">/**&lt; do not wait -- just see if it has finished */</span>
<a name="l00058"></a>00058 } <a class="code" href="group__apr__thread__proc.html#ga5e52d786644f3b66d6180571e68c7260">apr_wait_how_e</a>;
<a name="l00059"></a>00059 
<a name="l00060"></a>00060 <span class="comment">/* I am specifically calling out the values so that the macros below make</span>
<a name="l00061"></a>00061 <span class="comment"> * more sense.  Yes, I know I don&#39;t need to, but I am hoping this makes what</span>
<a name="l00062"></a>00062 <span class="comment"> * I am doing more clear.  If you want to add more reasons to exit, continue</span>
<a name="l00063"></a>00063 <span class="comment"> * to use bitmasks.</span>
<a name="l00064"></a>00064 <span class="comment"> */</span>
<a name="l00065"></a><a class="code" href="group__apr__thread__proc.html#gac097b4fa41e67024711c5983446d0951">00065</a> <span class="keyword">typedef</span> <span class="keyword">enum</span> {
<a name="l00066"></a><a class="code" href="group__apr__thread__proc.html#ggac097b4fa41e67024711c5983446d0951a977f140c82333af62aa4bed8c99a3ee2">00066</a>     <a class="code" href="group__apr__thread__proc.html#ggac097b4fa41e67024711c5983446d0951a977f140c82333af62aa4bed8c99a3ee2">APR_PROC_EXIT</a> = 1,          <span class="comment">/**&lt; process exited normally */</span>
<a name="l00067"></a><a class="code" href="group__apr__thread__proc.html#ggac097b4fa41e67024711c5983446d0951a7e3421d18abe458ca27822d19424225b">00067</a>     <a class="code" href="group__apr__thread__proc.html#ggac097b4fa41e67024711c5983446d0951a7e3421d18abe458ca27822d19424225b">APR_PROC_SIGNAL</a> = 2,        <span class="comment">/**&lt; process exited due to a signal */</span>
<a name="l00068"></a><a class="code" href="group__apr__thread__proc.html#ggac097b4fa41e67024711c5983446d0951a6b667be4983cb59e9bed37ee05a0dcce">00068</a>     <a class="code" href="group__apr__thread__proc.html#ggac097b4fa41e67024711c5983446d0951a6b667be4983cb59e9bed37ee05a0dcce">APR_PROC_SIGNAL_CORE</a> = 4    <span class="comment">/**&lt; process exited and dumped a core file */</span>
<a name="l00069"></a>00069 } <a class="code" href="group__apr__thread__proc.html#gac097b4fa41e67024711c5983446d0951">apr_exit_why_e</a>;
<a name="l00070"></a>00070 <span class="comment"></span>
<a name="l00071"></a>00071 <span class="comment">/** did we exit the process */</span>
<a name="l00072"></a><a class="code" href="group__apr__thread__proc.html#ga689b0f3953cde83a4092931bad8b7183">00072</a> <span class="preprocessor">#define APR_PROC_CHECK_EXIT(x)        (x &amp; APR_PROC_EXIT)</span>
<a name="l00073"></a>00073 <span class="preprocessor"></span><span class="comment">/** did we get a signal */</span>
<a name="l00074"></a><a class="code" href="group__apr__thread__proc.html#gaa0a8a0b8785cc9392059c7accd71f5f6">00074</a> <span class="preprocessor">#define APR_PROC_CHECK_SIGNALED(x)    (x &amp; APR_PROC_SIGNAL)</span>
<a name="l00075"></a>00075 <span class="preprocessor"></span><span class="comment">/** did we get core */</span>
<a name="l00076"></a><a class="code" href="group__apr__thread__proc.html#ga2249e96191b5d98d33fb7875bce49410">00076</a> <span class="preprocessor">#define APR_PROC_CHECK_CORE_DUMP(x)   (x &amp; APR_PROC_SIGNAL_CORE)</span>
<a name="l00077"></a>00077 <span class="preprocessor"></span><span class="comment"></span>
<a name="l00078"></a>00078 <span class="comment">/** @see apr_procattr_io_set */</span>
<a name="l00079"></a><a class="code" href="group__apr__thread__proc.html#gab7cfcb8ed24e6c0a76cd41b5b113ae95">00079</a> <span class="preprocessor">#define APR_NO_PIPE          0</span>
<a name="l00080"></a>00080 <span class="preprocessor"></span><span class="comment">/** @see apr_procattr_io_set and apr_file_pipe_create_ex */</span>
<a name="l00081"></a><a class="code" href="group__apr__thread__proc.html#ga646af57314e71f4647243f36dd03e5ea">00081</a> <span class="preprocessor">#define APR_FULL_BLOCK       1</span>
<a name="l00082"></a>00082 <span class="preprocessor"></span><span class="comment">/** @see apr_procattr_io_set and apr_file_pipe_create_ex */</span>
<a name="l00083"></a><a class="code" href="group__apr__thread__proc.html#gae0707f76da785490830fc3491093767c">00083</a> <span class="preprocessor">#define APR_FULL_NONBLOCK    2</span>
<a name="l00084"></a>00084 <span class="preprocessor"></span><span class="comment">/** @see apr_procattr_io_set */</span>
<a name="l00085"></a><a class="code" href="group__apr__thread__proc.html#ga8653bab028b1c2b98754babc2547f988">00085</a> <span class="preprocessor">#define APR_PARENT_BLOCK     3</span>
<a name="l00086"></a>00086 <span class="preprocessor"></span><span class="comment">/** @see apr_procattr_io_set */</span>
<a name="l00087"></a><a class="code" href="group__apr__thread__proc.html#gacad9da4db7a22f46715e50fb8ec1c939">00087</a> <span class="preprocessor">#define APR_CHILD_BLOCK      4</span>
<a name="l00088"></a>00088 <span class="preprocessor"></span><span class="comment">/** @see apr_procattr_io_set */</span>
<a name="l00089"></a>00089 <span class="preprocessor">#define APR_NO_FILE          8</span>
<a name="l00090"></a>00090 <span class="preprocessor"></span><span class="comment"></span>
<a name="l00091"></a>00091 <span class="comment">/** @see apr_file_pipe_create_ex */</span>
<a name="l00092"></a><a class="code" href="group__apr__thread__proc.html#gaf8295548cb0821ee02249d6de8336bcb">00092</a> <span class="preprocessor">#define APR_READ_BLOCK       3</span>
<a name="l00093"></a>00093 <span class="preprocessor"></span><span class="comment">/** @see apr_file_pipe_create_ex */</span>
<a name="l00094"></a><a class="code" href="group__apr__thread__proc.html#ga36ff2de9664ad6995bd488b4ac715c9c">00094</a> <span class="preprocessor">#define APR_WRITE_BLOCK      4</span>
<a name="l00095"></a>00095 <span class="preprocessor"></span><span class="comment"></span>
<a name="l00096"></a>00096 <span class="comment">/** @see apr_procattr_io_set </span>
<a name="l00097"></a>00097 <span class="comment"> * @note Win32 only effective with version 1.2.12, portably introduced in 1.3.0</span>
<a name="l00098"></a>00098 <span class="comment"> */</span>
<a name="l00099"></a><a class="code" href="group__apr__thread__proc.html#ga597fb6a501c20cc3a597fe6c613f4310">00099</a> <span class="preprocessor">#define APR_NO_FILE          8</span>
<a name="l00100"></a>00100 <span class="preprocessor"></span><span class="comment"></span>
<a name="l00101"></a>00101 <span class="comment">/** @see apr_procattr_limit_set */</span>
<a name="l00102"></a><a class="code" href="group__apr__thread__proc.html#gaad8a94c7ac2be58fe035b2fd6efec84f">00102</a> <span class="preprocessor">#define APR_LIMIT_CPU        0</span>
<a name="l00103"></a>00103 <span class="preprocessor"></span><span class="comment">/** @see apr_procattr_limit_set */</span>
<a name="l00104"></a><a class="code" href="group__apr__thread__proc.html#ga6dbb01bb357b078acff8fd87e9c494e8">00104</a> <span class="preprocessor">#define APR_LIMIT_MEM        1</span>
<a name="l00105"></a>00105 <span class="preprocessor"></span><span class="comment">/** @see apr_procattr_limit_set */</span>
<a name="l00106"></a><a class="code" href="group__apr__thread__proc.html#ga72e9be453a20f4e78bc6d7bd95d7c333">00106</a> <span class="preprocessor">#define APR_LIMIT_NPROC      2</span>
<a name="l00107"></a>00107 <span class="preprocessor"></span><span class="comment">/** @see apr_procattr_limit_set */</span>
<a name="l00108"></a><a class="code" href="group__apr__thread__proc.html#ga18d73099d66988698a9ad2aebdce2c9f">00108</a> <span class="preprocessor">#define APR_LIMIT_NOFILE     3</span>
<a name="l00109"></a>00109 <span class="preprocessor"></span><span class="comment"></span>
<a name="l00110"></a>00110 <span class="comment">/**</span>
<a name="l00111"></a>00111 <span class="comment"> * @defgroup APR_OC Other Child Flags</span>
<a name="l00112"></a>00112 <span class="comment"> * @{</span>
<a name="l00113"></a>00113 <span class="comment"> */</span>
<a name="l00114"></a><a class="code" href="group___a_p_r___o_c.html#ga93a18b17cfedca0c7c99c696508c935b">00114</a> <span class="preprocessor">#define APR_OC_REASON_DEATH         0     </span><span class="comment">/**&lt; child has died, caller must call</span>
<a name="l00115"></a>00115 <span class="comment">                                           * unregister still */</span>
<a name="l00116"></a><a class="code" href="group___a_p_r___o_c.html#gae4cb4983512df7df00c9c0401efba9c9">00116</a> <span class="preprocessor">#define APR_OC_REASON_UNWRITABLE    1     </span><span class="comment">/**&lt; write_fd is unwritable */</span>
<a name="l00117"></a><a class="code" href="group___a_p_r___o_c.html#ga5ae054b0b4c7c8eea911c146ae9ccdce">00117</a> <span class="preprocessor">#define APR_OC_REASON_RESTART       2     </span><span class="comment">/**&lt; a restart is occuring, perform</span>
<a name="l00118"></a>00118 <span class="comment">                                           * any necessary cleanup (including</span>
<a name="l00119"></a>00119 <span class="comment">                                           * sending a special signal to child)</span>
<a name="l00120"></a>00120 <span class="comment">                                           */</span>
<a name="l00121"></a><a class="code" href="group___a_p_r___o_c.html#ga7fe88662b788e07800290f68575b2f4b">00121</a> <span class="preprocessor">#define APR_OC_REASON_UNREGISTER    3     </span><span class="comment">/**&lt; unregister has been called, do</span>
<a name="l00122"></a>00122 <span class="comment">                                           * whatever is necessary (including</span>
<a name="l00123"></a>00123 <span class="comment">                                           * kill the child) */</span>
<a name="l00124"></a><a class="code" href="group___a_p_r___o_c.html#ga5d441798b20b93bd1f609264d03690fb">00124</a> <span class="preprocessor">#define APR_OC_REASON_LOST          4     </span><span class="comment">/**&lt; somehow the child exited without</span>
<a name="l00125"></a>00125 <span class="comment">                                           * us knowing ... buggy os? */</span>
<a name="l00126"></a><a class="code" href="group___a_p_r___o_c.html#gaa4a7ca44f23d67e7e19fd59bf41abd6a">00126</a> <span class="preprocessor">#define APR_OC_REASON_RUNNING       5     </span><span class="comment">/**&lt; a health check is occuring, </span>
<a name="l00127"></a>00127 <span class="comment">                                           * for most maintainence functions</span>
<a name="l00128"></a>00128 <span class="comment">                                           * this is a no-op.</span>
<a name="l00129"></a>00129 <span class="comment">                                           */</span>
<a name="l00130"></a>00130 <span class="comment">/** @} */</span>
<a name="l00131"></a>00131 <span class="comment"></span>
<a name="l00132"></a>00132 <span class="comment">/** The APR process type */</span>
<a name="l00133"></a><a class="code" href="structapr__proc__t.html">00133</a> <span class="keyword">typedef</span> <span class="keyword">struct </span><a class="code" href="structapr__proc__t.html">apr_proc_t</a> {<span class="comment"></span>
<a name="l00134"></a>00134 <span class="comment">    /** The process ID */</span>
<a name="l00135"></a><a class="code" href="structapr__proc__t.html#a8a8ee4b234156485a72497023e7482e5">00135</a>     pid_t <a class="code" href="structapr__proc__t.html#a8a8ee4b234156485a72497023e7482e5">pid</a>;<span class="comment"></span>
<a name="l00136"></a>00136 <span class="comment">    /** Parent&#39;s side of pipe to child&#39;s stdin */</span>
<a name="l00137"></a><a class="code" href="structapr__proc__t.html#a914bda8939f9d17c9e2f238683fb994b">00137</a>     <a class="code" href="group__apr__file__io.html#gaa46e4763ac375ea3c7a43ba6f6099e22">apr_file_t</a> *<a class="code" href="structapr__proc__t.html#a914bda8939f9d17c9e2f238683fb994b">in</a>;<span class="comment"></span>
<a name="l00138"></a>00138 <span class="comment">    /** Parent&#39;s side of pipe to child&#39;s stdout */</span>
<a name="l00139"></a><a class="code" href="structapr__proc__t.html#acb7d7c5226217946d761f0e90ff70d24">00139</a>     <a class="code" href="group__apr__file__io.html#gaa46e4763ac375ea3c7a43ba6f6099e22">apr_file_t</a> *<a class="code" href="structapr__proc__t.html#acb7d7c5226217946d761f0e90ff70d24">out</a>;<span class="comment"></span>
<a name="l00140"></a>00140 <span class="comment">    /** Parent&#39;s side of pipe to child&#39;s stdouterr */</span>
<a name="l00141"></a><a class="code" href="structapr__proc__t.html#ad087f812b5c69ce937db4cf6e8cd5a0b">00141</a>     <a class="code" href="group__apr__file__io.html#gaa46e4763ac375ea3c7a43ba6f6099e22">apr_file_t</a> *<a class="code" href="structapr__proc__t.html#ad087f812b5c69ce937db4cf6e8cd5a0b">err</a>;
<a name="l00142"></a>00142 <span class="preprocessor">#if APR_HAS_PROC_INVOKED || defined(DOXYGEN)</span>
<a name="l00143"></a>00143 <span class="preprocessor"></span><span class="comment">    /** Diagnositics/debugging string of the command invoked for </span>
<a name="l00144"></a>00144 <span class="comment">     *  this process [only present if APR_HAS_PROC_INVOKED is true]</span>
<a name="l00145"></a>00145 <span class="comment">     * @remark Only enabled on Win32 by default.</span>
<a name="l00146"></a>00146 <span class="comment">     * @bug This should either always or never be present in release</span>
<a name="l00147"></a>00147 <span class="comment">     * builds - since it breaks binary compatibility.  We may enable</span>
<a name="l00148"></a>00148 <span class="comment">     * it always in APR 1.0 yet leave it undefined in most cases.</span>
<a name="l00149"></a>00149 <span class="comment">     */</span>
<a name="l00150"></a><a class="code" href="structapr__proc__t.html#a72ed1c58c3f08ffa7202fa80e870cd54">00150</a>     <span class="keywordtype">char</span> *<a class="code" href="structapr__proc__t.html#a72ed1c58c3f08ffa7202fa80e870cd54">invoked</a>;
<a name="l00151"></a>00151 <span class="preprocessor">#endif</span>
<a name="l00152"></a>00152 <span class="preprocessor"></span><span class="preprocessor">#if defined(WIN32) || defined(DOXYGEN)</span>
<a name="l00153"></a>00153 <span class="preprocessor"></span><span class="comment">    /** (Win32 only) Creator&#39;s handle granting access to the process</span>
<a name="l00154"></a>00154 <span class="comment">     * @remark This handle is closed and reset to NULL in every case</span>
<a name="l00155"></a>00155 <span class="comment">     * corresponding to a waitpid() on Unix which returns the exit status.</span>
<a name="l00156"></a>00156 <span class="comment">     * Therefore Win32 correspond&#39;s to Unix&#39;s zombie reaping characteristics</span>
<a name="l00157"></a>00157 <span class="comment">     * and avoids potential handle leaks.</span>
<a name="l00158"></a>00158 <span class="comment">     */</span>
<a name="l00159"></a><a class="code" href="structapr__proc__t.html#aa1f17cce2b442d92893b9c63053b6771">00159</a>     HANDLE <a class="code" href="structapr__proc__t.html#aa1f17cce2b442d92893b9c63053b6771">hproc</a>;
<a name="l00160"></a>00160 <span class="preprocessor">#endif</span>
<a name="l00161"></a>00161 <span class="preprocessor"></span>} <a class="code" href="structapr__proc__t.html">apr_proc_t</a>;
<a name="l00162"></a>00162 <span class="comment"></span>
<a name="l00163"></a>00163 <span class="comment">/**</span>
<a name="l00164"></a>00164 <span class="comment"> * The prototype for APR child errfn functions.  (See the description</span>
<a name="l00165"></a>00165 <span class="comment"> * of apr_procattr_child_errfn_set() for more information.)</span>
<a name="l00166"></a>00166 <span class="comment"> * It is passed the following parameters:</span>
<a name="l00167"></a>00167 <span class="comment"> * @param pool Pool associated with the apr_proc_t.  If your child</span>
<a name="l00168"></a>00168 <span class="comment"> *             error function needs user data, associate it with this</span>
<a name="l00169"></a>00169 <span class="comment"> *             pool.</span>
<a name="l00170"></a>00170 <span class="comment"> * @param err APR error code describing the error</span>
<a name="l00171"></a>00171 <span class="comment"> * @param description Text description of type of processing which failed</span>
<a name="l00172"></a>00172 <span class="comment"> */</span>
<a name="l00173"></a><a class="code" href="group__apr__thread__proc.html#ga8f8642f468f05b0ac2b1426b723af100">00173</a> <span class="keyword">typedef</span> void (<a class="code" href="group__apr__thread__proc.html#ga8f8642f468f05b0ac2b1426b723af100">apr_child_errfn_t</a>)(<a class="code" href="group__apr__pools.html#gaf137f28edcf9a086cd6bc36c20d7cdfb">apr_pool_t</a> *proc, <a class="code" href="group__apr__errno.html#gaf76ee4543247e9fb3f3546203e590a6c">apr_status_t</a> err,
<a name="l00174"></a>00174                                  <span class="keyword">const</span> <span class="keywordtype">char</span> *description);
<a name="l00175"></a>00175 <span class="comment"></span>
<a name="l00176"></a>00176 <span class="comment">/** Opaque Thread structure. */</span>
<a name="l00177"></a><a class="code" href="group__apr__thread__proc.html#ga646c71351e723d84f8cc8c8d1d5937be">00177</a> <span class="keyword">typedef</span> <span class="keyword">struct </span><a class="code" href="group__apr__thread__proc.html#ga646c71351e723d84f8cc8c8d1d5937be">apr_thread_t</a>           <a class="code" href="group__apr__thread__proc.html#ga646c71351e723d84f8cc8c8d1d5937be">apr_thread_t</a>;
<a name="l00178"></a>00178 <span class="comment"></span>
<a name="l00179"></a>00179 <span class="comment">/** Opaque Thread attributes structure. */</span>
<a name="l00180"></a><a class="code" href="group__apr__thread__proc.html#ga35de571e9944871c10b38d8feef885ac">00180</a> <span class="keyword">typedef</span> <span class="keyword">struct </span><a class="code" href="group__apr__thread__proc.html#ga35de571e9944871c10b38d8feef885ac">apr_threadattr_t</a>       <a class="code" href="group__apr__thread__proc.html#ga35de571e9944871c10b38d8feef885ac">apr_threadattr_t</a>;
<a name="l00181"></a>00181 <span class="comment"></span>
<a name="l00182"></a>00182 <span class="comment">/** Opaque Process attributes structure. */</span>
<a name="l00183"></a><a class="code" href="group__apr__thread__proc.html#ga0d83919a6a0dd609598a864917f8b339">00183</a> <span class="keyword">typedef</span> <span class="keyword">struct </span><a class="code" href="group__apr__thread__proc.html#ga0d83919a6a0dd609598a864917f8b339">apr_procattr_t</a>         <a class="code" href="group__apr__thread__proc.html#ga0d83919a6a0dd609598a864917f8b339">apr_procattr_t</a>;
<a name="l00184"></a>00184 <span class="comment"></span>
<a name="l00185"></a>00185 <span class="comment">/** Opaque control variable for one-time atomic variables.  */</span>
<a name="l00186"></a><a class="code" href="group__apr__thread__proc.html#ga91841bcf20d0579e8e6acc6d3c220ac1">00186</a> <span class="keyword">typedef</span> <span class="keyword">struct </span><a class="code" href="group__apr__thread__proc.html#ga91841bcf20d0579e8e6acc6d3c220ac1">apr_thread_once_t</a>      <a class="code" href="group__apr__thread__proc.html#ga91841bcf20d0579e8e6acc6d3c220ac1">apr_thread_once_t</a>;
<a name="l00187"></a>00187 <span class="comment"></span>
<a name="l00188"></a>00188 <span class="comment">/** Opaque thread private address space. */</span>
<a name="l00189"></a><a class="code" href="group__apr__thread__proc.html#ga337c9c1bd2d47740022071a5c41f2edb">00189</a> <span class="keyword">typedef</span> <span class="keyword">struct </span><a class="code" href="group__apr__thread__proc.html#ga337c9c1bd2d47740022071a5c41f2edb">apr_threadkey_t</a>        <a class="code" href="group__apr__thread__proc.html#ga337c9c1bd2d47740022071a5c41f2edb">apr_threadkey_t</a>;
<a name="l00190"></a>00190 <span class="comment"></span>
<a name="l00191"></a>00191 <span class="comment">/** Opaque record of child process. */</span>
<a name="l00192"></a><a class="code" href="group__apr__thread__proc.html#gafc52ee8b19a7b222278d31ebb3f11a71">00192</a> <span class="keyword">typedef</span> <span class="keyword">struct </span><a class="code" href="group__apr__thread__proc.html#gafc52ee8b19a7b222278d31ebb3f11a71">apr_other_child_rec_t</a>  <a class="code" href="group__apr__thread__proc.html#gafc52ee8b19a7b222278d31ebb3f11a71">apr_other_child_rec_t</a>;
<a name="l00193"></a>00193 <span class="comment"></span>
<a name="l00194"></a>00194 <span class="comment">/**</span>
<a name="l00195"></a>00195 <span class="comment"> * The prototype for any APR thread worker functions.</span>
<a name="l00196"></a>00196 <span class="comment"> */</span>
<a name="l00197"></a><a class="code" href="group__apr__thread__proc.html#ga37193850d158ca870fc8f8759f0725a9">00197</a> <span class="keyword">typedef</span> <span class="keywordtype">void</span> *(<a class="code" href="group__apr__platform.html#gade8f829f9bd98fd4386894acf72edd7c">APR_THREAD_FUNC</a> *<a class="code" href="group__apr__thread__proc.html#ga37193850d158ca870fc8f8759f0725a9">apr_thread_start_t</a>)(<a class="code" href="group__apr__thread__proc.html#ga646c71351e723d84f8cc8c8d1d5937be">apr_thread_t</a>*, <span class="keywordtype">void</span>*);
<a name="l00198"></a>00198 
<a name="l00199"></a><a class="code" href="group__apr__thread__proc.html#ga3eaec78633742e7e0cb9480a21477aff">00199</a> <span class="keyword">typedef</span> <span class="keyword">enum</span> {
<a name="l00200"></a><a class="code" href="group__apr__thread__proc.html#gga3eaec78633742e7e0cb9480a21477affa33580ab0809e9498855fbdde8a1714ef">00200</a>     <a class="code" href="group__apr__thread__proc.html#gga3eaec78633742e7e0cb9480a21477affa33580ab0809e9498855fbdde8a1714ef">APR_KILL_NEVER</a>,             <span class="comment">/**&lt; process is never sent any signals */</span>
<a name="l00201"></a><a class="code" href="group__apr__thread__proc.html#gga3eaec78633742e7e0cb9480a21477affaf45d0f72811399b394d1311384e2dfe4">00201</a>     <a class="code" href="group__apr__thread__proc.html#gga3eaec78633742e7e0cb9480a21477affaf45d0f72811399b394d1311384e2dfe4">APR_KILL_ALWAYS</a>,            <span class="comment">/**&lt; process is sent SIGKILL on apr_pool_t cleanup */</span>
<a name="l00202"></a><a class="code" href="group__apr__thread__proc.html#gga3eaec78633742e7e0cb9480a21477affa16a47aa786b1c1f31ef02353bcae9a1a">00202</a>     <a class="code" href="group__apr__thread__proc.html#gga3eaec78633742e7e0cb9480a21477affa16a47aa786b1c1f31ef02353bcae9a1a">APR_KILL_AFTER_TIMEOUT</a>,     <span class="comment">/**&lt; SIGTERM, wait 3 seconds, SIGKILL */</span>
<a name="l00203"></a><a class="code" href="group__apr__thread__proc.html#gga3eaec78633742e7e0cb9480a21477affa6ada2605856ac94826edbe824e64e503">00203</a>     <a class="code" href="group__apr__thread__proc.html#gga3eaec78633742e7e0cb9480a21477affa6ada2605856ac94826edbe824e64e503">APR_JUST_WAIT</a>,              <span class="comment">/**&lt; wait forever for the process to complete */</span>
<a name="l00204"></a><a class="code" href="group__apr__thread__proc.html#gga3eaec78633742e7e0cb9480a21477affa24d6f47785093be4cea2a922eeaed098">00204</a>     <a class="code" href="group__apr__thread__proc.html#gga3eaec78633742e7e0cb9480a21477affa24d6f47785093be4cea2a922eeaed098">APR_KILL_ONLY_ONCE</a>          <span class="comment">/**&lt; send SIGTERM and then wait */</span>
<a name="l00205"></a>00205 } <a class="code" href="group__apr__thread__proc.html#ga3eaec78633742e7e0cb9480a21477aff">apr_kill_conditions_e</a>;
<a name="l00206"></a>00206 
<a name="l00207"></a>00207 <span class="comment">/* Thread Function definitions */</span>
<a name="l00208"></a>00208 
<a name="l00209"></a>00209 <span class="preprocessor">#if APR_HAS_THREADS</span>
<a name="l00210"></a>00210 <span class="preprocessor"></span><span class="comment"></span>
<a name="l00211"></a>00211 <span class="comment">/**</span>
<a name="l00212"></a>00212 <span class="comment"> * Create and initialize a new threadattr variable</span>
<a name="l00213"></a>00213 <span class="comment"> * @param new_attr The newly created threadattr.</span>
<a name="l00214"></a>00214 <span class="comment"> * @param cont The pool to use</span>
<a name="l00215"></a>00215 <span class="comment"> */</span>
<a name="l00216"></a>00216 <a class="code" href="group__apr__platform.html#gad7b91b811a172bfa802603c2fb688f98">APR_DECLARE</a>(<a class="code" href="group__apr__errno.html#gaf76ee4543247e9fb3f3546203e590a6c">apr_status_t</a>) <a class="code" href="group__apr__thread__proc.html#ga66c2f55e5dff9ac37bd32e9febd38da5">apr_threadattr_create</a>(<a class="code" href="group__apr__thread__proc.html#ga35de571e9944871c10b38d8feef885ac">apr_threadattr_t</a> **new_attr, 
<a name="l00217"></a>00217                                                 <a class="code" href="group__apr__pools.html#gaf137f28edcf9a086cd6bc36c20d7cdfb">apr_pool_t</a> *cont);
<a name="l00218"></a>00218 <span class="comment"></span>
<a name="l00219"></a>00219 <span class="comment">/**</span>
<a name="l00220"></a>00220 <span class="comment"> * Set if newly created threads should be created in detached state.</span>
<a name="l00221"></a>00221 <span class="comment"> * @param attr The threadattr to affect </span>
<a name="l00222"></a>00222 <span class="comment"> * @param on Non-zero if detached threads should be created.</span>
<a name="l00223"></a>00223 <span class="comment"> */</span>
<a name="l00224"></a>00224 <a class="code" href="group__apr__platform.html#gad7b91b811a172bfa802603c2fb688f98">APR_DECLARE</a>(<a class="code" href="group__apr__errno.html#gaf76ee4543247e9fb3f3546203e590a6c">apr_status_t</a>) <a class="code" href="group__apr__thread__proc.html#ga85d44b3b021f28116122d5e40e024648">apr_threadattr_detach_set</a>(<a class="code" href="group__apr__thread__proc.html#ga35de571e9944871c10b38d8feef885ac">apr_threadattr_t</a> *attr, 
<a name="l00225"></a>00225                                                     apr_int32_t on);
<a name="l00226"></a>00226 <span class="comment"></span>
<a name="l00227"></a>00227 <span class="comment">/**</span>
<a name="l00228"></a>00228 <span class="comment"> * Get the detach state for this threadattr.</span>
<a name="l00229"></a>00229 <span class="comment"> * @param attr The threadattr to reference</span>
<a name="l00230"></a>00230 <span class="comment"> * @return APR_DETACH if threads are to be detached, or APR_NOTDETACH</span>
<a name="l00231"></a>00231 <span class="comment"> * if threads are to be joinable. </span>
<a name="l00232"></a>00232 <span class="comment"> */</span>
<a name="l00233"></a>00233 <a class="code" href="group__apr__platform.html#gad7b91b811a172bfa802603c2fb688f98">APR_DECLARE</a>(<a class="code" href="group__apr__errno.html#gaf76ee4543247e9fb3f3546203e590a6c">apr_status_t</a>) <a class="code" href="group__apr__thread__proc.html#gae5b7cdb3de542d1b7b52fe5d9d8cb00b">apr_threadattr_detach_get</a>(<a class="code" href="group__apr__thread__proc.html#ga35de571e9944871c10b38d8feef885ac">apr_threadattr_t</a> *attr);
<a name="l00234"></a>00234 <span class="comment"></span>
<a name="l00235"></a>00235 <span class="comment">/**</span>
<a name="l00236"></a>00236 <span class="comment"> * Set the stack size of newly created threads.</span>
<a name="l00237"></a>00237 <span class="comment"> * @param attr The threadattr to affect </span>
<a name="l00238"></a>00238 <span class="comment"> * @param stacksize The stack size in bytes</span>
<a name="l00239"></a>00239 <span class="comment"> */</span>
<a name="l00240"></a>00240 <a class="code" href="group__apr__platform.html#gad7b91b811a172bfa802603c2fb688f98">APR_DECLARE</a>(<a class="code" href="group__apr__errno.html#gaf76ee4543247e9fb3f3546203e590a6c">apr_status_t</a>) <a class="code" href="group__apr__thread__proc.html#ga7849e0d637338a18cb44f66f11f28ed1">apr_threadattr_stacksize_set</a>(<a class="code" href="group__apr__thread__proc.html#ga35de571e9944871c10b38d8feef885ac">apr_threadattr_t</a> *attr,
<a name="l00241"></a>00241                                                        apr_size_t stacksize);
<a name="l00242"></a>00242 <span class="comment"></span>
<a name="l00243"></a>00243 <span class="comment">/**</span>
<a name="l00244"></a>00244 <span class="comment"> * Set the stack guard area size of newly created threads.</span>
<a name="l00245"></a>00245 <span class="comment"> * @param attr The threadattr to affect </span>
<a name="l00246"></a>00246 <span class="comment"> * @param guardsize The stack guard area size in bytes</span>
<a name="l00247"></a>00247 <span class="comment"> * @note Thread library implementations commonly use a &quot;guard area&quot;</span>
<a name="l00248"></a>00248 <span class="comment"> * after each thread&#39;s stack which is not readable or writable such that</span>
<a name="l00249"></a>00249 <span class="comment"> * stack overflows cause a segfault; this consumes e.g. 4K of memory</span>
<a name="l00250"></a>00250 <span class="comment"> * and increases memory management overhead.  Setting the guard area</span>
<a name="l00251"></a>00251 <span class="comment"> * size to zero hence trades off reliable behaviour on stack overflow</span>
<a name="l00252"></a>00252 <span class="comment"> * for performance. */</span>
<a name="l00253"></a>00253 <a class="code" href="group__apr__platform.html#gad7b91b811a172bfa802603c2fb688f98">APR_DECLARE</a>(<a class="code" href="group__apr__errno.html#gaf76ee4543247e9fb3f3546203e590a6c">apr_status_t</a>) <a class="code" href="group__apr__thread__proc.html#ga2e732f2913291180c0c484f57d727140">apr_threadattr_guardsize_set</a>(<a class="code" href="group__apr__thread__proc.html#ga35de571e9944871c10b38d8feef885ac">apr_threadattr_t</a> *attr,
<a name="l00254"></a>00254                                                        apr_size_t guardsize);
<a name="l00255"></a>00255 <span class="comment"></span>
<a name="l00256"></a>00256 <span class="comment">/**</span>
<a name="l00257"></a>00257 <span class="comment"> * Create a new thread of execution</span>
<a name="l00258"></a>00258 <span class="comment"> * @param new_thread The newly created thread handle.</span>
<a name="l00259"></a>00259 <span class="comment"> * @param attr The threadattr to use to determine how to create the thread</span>
<a name="l00260"></a>00260 <span class="comment"> * @param func The function to start the new thread in</span>
<a name="l00261"></a>00261 <span class="comment"> * @param data Any data to be passed to the starting function</span>
<a name="l00262"></a>00262 <span class="comment"> * @param cont The pool to use</span>
<a name="l00263"></a>00263 <span class="comment"> */</span>
<a name="l00264"></a>00264 <a class="code" href="group__apr__platform.html#gad7b91b811a172bfa802603c2fb688f98">APR_DECLARE</a>(<a class="code" href="group__apr__errno.html#gaf76ee4543247e9fb3f3546203e590a6c">apr_status_t</a>) <a class="code" href="group__apr__thread__proc.html#gaeba6593f43f1de94c2b4495dd72b0e9f">apr_thread_create</a>(<a class="code" href="group__apr__thread__proc.html#ga646c71351e723d84f8cc8c8d1d5937be">apr_thread_t</a> **new_thread, 
<a name="l00265"></a>00265                                             <a class="code" href="group__apr__thread__proc.html#ga35de571e9944871c10b38d8feef885ac">apr_threadattr_t</a> *attr, 
<a name="l00266"></a>00266                                             <a class="code" href="group__apr__thread__proc.html#ga37193850d158ca870fc8f8759f0725a9">apr_thread_start_t</a> func, 
<a name="l00267"></a>00267                                             <span class="keywordtype">void</span> *data, <a class="code" href="group__apr__pools.html#gaf137f28edcf9a086cd6bc36c20d7cdfb">apr_pool_t</a> *cont);
<a name="l00268"></a>00268 <span class="comment"></span>
<a name="l00269"></a>00269 <span class="comment">/**</span>
<a name="l00270"></a>00270 <span class="comment"> * stop the current thread</span>
<a name="l00271"></a>00271 <span class="comment"> * @param thd The thread to stop</span>
<a name="l00272"></a>00272 <span class="comment"> * @param retval The return value to pass back to any thread that cares</span>
<a name="l00273"></a>00273 <span class="comment"> */</span>
<a name="l00274"></a>00274 <a class="code" href="group__apr__platform.html#gad7b91b811a172bfa802603c2fb688f98">APR_DECLARE</a>(<a class="code" href="group__apr__errno.html#gaf76ee4543247e9fb3f3546203e590a6c">apr_status_t</a>) <a class="code" href="group__apr__thread__proc.html#ga0e35365e530578bca1b4bea522ac8c85">apr_thread_exit</a>(<a class="code" href="group__apr__thread__proc.html#ga646c71351e723d84f8cc8c8d1d5937be">apr_thread_t</a> *thd, 
<a name="l00275"></a>00275                                           <a class="code" href="group__apr__errno.html#gaf76ee4543247e9fb3f3546203e590a6c">apr_status_t</a> retval);
<a name="l00276"></a>00276 <span class="comment"></span>
<a name="l00277"></a>00277 <span class="comment">/**</span>
<a name="l00278"></a>00278 <span class="comment"> * block until the desired thread stops executing.</span>
<a name="l00279"></a>00279 <span class="comment"> * @param retval The return value from the dead thread.</span>
<a name="l00280"></a>00280 <span class="comment"> * @param thd The thread to join</span>
<a name="l00281"></a>00281 <span class="comment"> */</span>
<a name="l00282"></a>00282 <a class="code" href="group__apr__platform.html#gad7b91b811a172bfa802603c2fb688f98">APR_DECLARE</a>(<a class="code" href="group__apr__errno.html#gaf76ee4543247e9fb3f3546203e590a6c">apr_status_t</a>) <a class="code" href="group__apr__thread__proc.html#ga1b950f36fa5bcd5a64887073f46f6d13">apr_thread_join</a>(<a class="code" href="group__apr__errno.html#gaf76ee4543247e9fb3f3546203e590a6c">apr_status_t</a> *retval, 
<a name="l00283"></a>00283                                           <a class="code" href="group__apr__thread__proc.html#ga646c71351e723d84f8cc8c8d1d5937be">apr_thread_t</a> *thd); 
<a name="l00284"></a>00284 <span class="comment"></span>
<a name="l00285"></a>00285 <span class="comment">/**</span>
<a name="l00286"></a>00286 <span class="comment"> * force the current thread to yield the processor</span>
<a name="l00287"></a>00287 <span class="comment"> */</span>
<a name="l00288"></a>00288 <a class="code" href="group__apr__platform.html#gad7b91b811a172bfa802603c2fb688f98">APR_DECLARE</a>(<span class="keywordtype">void</span>) <a class="code" href="group__apr__thread__proc.html#gacd69fb862c069cb6f297f65d64b5c102">apr_thread_yield</a>(<span class="keywordtype">void</span>);
<a name="l00289"></a>00289 <span class="comment"></span>
<a name="l00290"></a>00290 <span class="comment">/**</span>
<a name="l00291"></a>00291 <span class="comment"> * Initialize the control variable for apr_thread_once.  If this isn&#39;t</span>
<a name="l00292"></a>00292 <span class="comment"> * called, apr_initialize won&#39;t work.</span>
<a name="l00293"></a>00293 <span class="comment"> * @param control The control variable to initialize</span>
<a name="l00294"></a>00294 <span class="comment"> * @param p The pool to allocate data from.</span>
<a name="l00295"></a>00295 <span class="comment"> */</span>
<a name="l00296"></a>00296 <a class="code" href="group__apr__platform.html#gad7b91b811a172bfa802603c2fb688f98">APR_DECLARE</a>(<a class="code" href="group__apr__errno.html#gaf76ee4543247e9fb3f3546203e590a6c">apr_status_t</a>) <a class="code" href="group__apr__thread__proc.html#ga63f3bf667151053e45d5a2029daeda0d">apr_thread_once_init</a>(<a class="code" href="group__apr__thread__proc.html#ga91841bcf20d0579e8e6acc6d3c220ac1">apr_thread_once_t</a> **control,
<a name="l00297"></a>00297                                                <a class="code" href="group__apr__pools.html#gaf137f28edcf9a086cd6bc36c20d7cdfb">apr_pool_t</a> *p);
<a name="l00298"></a>00298 <span class="comment"></span>
<a name="l00299"></a>00299 <span class="comment">/**</span>
<a name="l00300"></a>00300 <span class="comment"> * Run the specified function one time, regardless of how many threads</span>
<a name="l00301"></a>00301 <span class="comment"> * call it.</span>
<a name="l00302"></a>00302 <span class="comment"> * @param control The control variable.  The same variable should</span>
<a name="l00303"></a>00303 <span class="comment"> *                be passed in each time the function is tried to be</span>
<a name="l00304"></a>00304 <span class="comment"> *                called.  This is how the underlying functions determine</span>
<a name="l00305"></a>00305 <span class="comment"> *                if the function has ever been called before.</span>
<a name="l00306"></a>00306 <span class="comment"> * @param func The function to call.</span>
<a name="l00307"></a>00307 <span class="comment"> */</span>
<a name="l00308"></a>00308 <a class="code" href="group__apr__platform.html#gad7b91b811a172bfa802603c2fb688f98">APR_DECLARE</a>(<a class="code" href="group__apr__errno.html#gaf76ee4543247e9fb3f3546203e590a6c">apr_status_t</a>) <a class="code" href="group__apr__thread__proc.html#ga8f3645ee52ff07566c92181b4ce732d8">apr_thread_once</a>(<a class="code" href="group__apr__thread__proc.html#ga91841bcf20d0579e8e6acc6d3c220ac1">apr_thread_once_t</a> *control,
<a name="l00309"></a>00309                                           <span class="keywordtype">void</span> (*func)(<span class="keywordtype">void</span>));
<a name="l00310"></a>00310 <span class="comment"></span>
<a name="l00311"></a>00311 <span class="comment">/**</span>
<a name="l00312"></a>00312 <span class="comment"> * detach a thread</span>
<a name="l00313"></a>00313 <span class="comment"> * @param thd The thread to detach </span>
<a name="l00314"></a>00314 <span class="comment"> */</span>
<a name="l00315"></a>00315 <a class="code" href="group__apr__platform.html#gad7b91b811a172bfa802603c2fb688f98">APR_DECLARE</a>(<a class="code" href="group__apr__errno.html#gaf76ee4543247e9fb3f3546203e590a6c">apr_status_t</a>) <a class="code" href="group__apr__thread__proc.html#gadbd186912d5f6f2a19a175e1e02ba10e">apr_thread_detach</a>(<a class="code" href="group__apr__thread__proc.html#ga646c71351e723d84f8cc8c8d1d5937be">apr_thread_t</a> *thd);
<a name="l00316"></a>00316 <span class="comment"></span>
<a name="l00317"></a>00317 <span class="comment">/**</span>
<a name="l00318"></a>00318 <span class="comment"> * Return the pool associated with the current thread.</span>
<a name="l00319"></a>00319 <span class="comment"> * @param data The user data associated with the thread.</span>
<a name="l00320"></a>00320 <span class="comment"> * @param key The key to associate with the data</span>
<a name="l00321"></a>00321 <span class="comment"> * @param thread The currently open thread.</span>
<a name="l00322"></a>00322 <span class="comment"> */</span>
<a name="l00323"></a>00323 <a class="code" href="group__apr__platform.html#gad7b91b811a172bfa802603c2fb688f98">APR_DECLARE</a>(<a class="code" href="group__apr__errno.html#gaf76ee4543247e9fb3f3546203e590a6c">apr_status_t</a>) <a class="code" href="group__apr__thread__proc.html#gad799c8140ed068a12f1dbe134423eae7">apr_thread_data_get</a>(<span class="keywordtype">void</span> **data, const <span class="keywordtype">char</span> *key,
<a name="l00324"></a>00324                                              <a class="code" href="group__apr__thread__proc.html#ga646c71351e723d84f8cc8c8d1d5937be">apr_thread_t</a> *thread);
<a name="l00325"></a>00325 <span class="comment"></span>
<a name="l00326"></a>00326 <span class="comment">/**</span>
<a name="l00327"></a>00327 <span class="comment"> * Return the pool associated with the current thread.</span>
<a name="l00328"></a>00328 <span class="comment"> * @param data The user data to associate with the thread.</span>
<a name="l00329"></a>00329 <span class="comment"> * @param key The key to use for associating the data with the thread</span>
<a name="l00330"></a>00330 <span class="comment"> * @param cleanup The cleanup routine to use when the thread is destroyed.</span>
<a name="l00331"></a>00331 <span class="comment"> * @param thread The currently open thread.</span>
<a name="l00332"></a>00332 <span class="comment"> */</span>
<a name="l00333"></a>00333 <a class="code" href="group__apr__platform.html#gad7b91b811a172bfa802603c2fb688f98">APR_DECLARE</a>(<a class="code" href="group__apr__errno.html#gaf76ee4543247e9fb3f3546203e590a6c">apr_status_t</a>) <a class="code" href="group__apr__thread__proc.html#gaa90d79c9935692db4f27a6573f437221">apr_thread_data_set</a>(<span class="keywordtype">void</span> *data, const <span class="keywordtype">char</span> *key,
<a name="l00334"></a>00334                                              <a class="code" href="group__apr__errno.html#gaf76ee4543247e9fb3f3546203e590a6c">apr_status_t</a> (*cleanup) (<span class="keywordtype">void</span> *),
<a name="l00335"></a>00335                                              <a class="code" href="group__apr__thread__proc.html#ga646c71351e723d84f8cc8c8d1d5937be">apr_thread_t</a> *thread);
<a name="l00336"></a>00336 <span class="comment"></span>
<a name="l00337"></a>00337 <span class="comment">/**</span>
<a name="l00338"></a>00338 <span class="comment"> * Create and initialize a new thread private address space</span>
<a name="l00339"></a>00339 <span class="comment"> * @param key The thread private handle.</span>
<a name="l00340"></a>00340 <span class="comment"> * @param dest The destructor to use when freeing the private memory.</span>
<a name="l00341"></a>00341 <span class="comment"> * @param cont The pool to use</span>
<a name="l00342"></a>00342 <span class="comment"> */</span>
<a name="l00343"></a>00343 <a class="code" href="group__apr__platform.html#gad7b91b811a172bfa802603c2fb688f98">APR_DECLARE</a>(<a class="code" href="group__apr__errno.html#gaf76ee4543247e9fb3f3546203e590a6c">apr_status_t</a>) <a class="code" href="group__apr__thread__proc.html#gacb9553b2b3165388bfc0a54b1148804a">apr_threadkey_private_create</a>(<a class="code" href="group__apr__thread__proc.html#ga337c9c1bd2d47740022071a5c41f2edb">apr_threadkey_t</a> **key, 
<a name="l00344"></a>00344                                                     <span class="keywordtype">void</span> (*dest)(<span class="keywordtype">void</span> *),
<a name="l00345"></a>00345                                                     <a class="code" href="group__apr__pools.html#gaf137f28edcf9a086cd6bc36c20d7cdfb">apr_pool_t</a> *cont);
<a name="l00346"></a>00346 <span class="comment"></span>
<a name="l00347"></a>00347 <span class="comment">/**</span>
<a name="l00348"></a>00348 <span class="comment"> * Get a pointer to the thread private memory</span>
<a name="l00349"></a>00349 <span class="comment"> * @param new_mem The data stored in private memory </span>
<a name="l00350"></a>00350 <span class="comment"> * @param key The handle for the desired thread private memory </span>
<a name="l00351"></a>00351 <span class="comment"> */</span>
<a name="l00352"></a>00352 <a class="code" href="group__apr__platform.html#gad7b91b811a172bfa802603c2fb688f98">APR_DECLARE</a>(<a class="code" href="group__apr__errno.html#gaf76ee4543247e9fb3f3546203e590a6c">apr_status_t</a>) <a class="code" href="group__apr__thread__proc.html#ga371c87c122cc3df0b7ad0031f6e11167">apr_threadkey_private_get</a>(<span class="keywordtype">void</span> **new_mem, 
<a name="l00353"></a>00353                                                  <a class="code" href="group__apr__thread__proc.html#ga337c9c1bd2d47740022071a5c41f2edb">apr_threadkey_t</a> *key);
<a name="l00354"></a>00354 <span class="comment"></span>
<a name="l00355"></a>00355 <span class="comment">/**</span>
<a name="l00356"></a>00356 <span class="comment"> * Set the data to be stored in thread private memory</span>
<a name="l00357"></a>00357 <span class="comment"> * @param priv The data to be stored in private memory </span>
<a name="l00358"></a>00358 <span class="comment"> * @param key The handle for the desired thread private memory </span>
<a name="l00359"></a>00359 <span class="comment"> */</span>
<a name="l00360"></a>00360 <a class="code" href="group__apr__platform.html#gad7b91b811a172bfa802603c2fb688f98">APR_DECLARE</a>(<a class="code" href="group__apr__errno.html#gaf76ee4543247e9fb3f3546203e590a6c">apr_status_t</a>) <a class="code" href="group__apr__thread__proc.html#ga63501a064ca7f1818aa056b40146aa0b">apr_threadkey_private_set</a>(<span class="keywordtype">void</span> *priv, 
<a name="l00361"></a>00361                                                  <a class="code" href="group__apr__thread__proc.html#ga337c9c1bd2d47740022071a5c41f2edb">apr_threadkey_t</a> *key);
<a name="l00362"></a>00362 <span class="comment"></span>
<a name="l00363"></a>00363 <span class="comment">/**</span>
<a name="l00364"></a>00364 <span class="comment"> * Free the thread private memory</span>
<a name="l00365"></a>00365 <span class="comment"> * @param key The handle for the desired thread private memory </span>
<a name="l00366"></a>00366 <span class="comment"> */</span>
<a name="l00367"></a>00367 <a class="code" href="group__apr__platform.html#gad7b91b811a172bfa802603c2fb688f98">APR_DECLARE</a>(<a class="code" href="group__apr__errno.html#gaf76ee4543247e9fb3f3546203e590a6c">apr_status_t</a>) <a class="code" href="group__apr__thread__proc.html#ga20b9b79892a6532784fff023a4ebd8cf">apr_threadkey_private_delete</a>(<a class="code" href="group__apr__thread__proc.html#ga337c9c1bd2d47740022071a5c41f2edb">apr_threadkey_t</a> *key);
<a name="l00368"></a>00368 <span class="comment"></span>
<a name="l00369"></a>00369 <span class="comment">/**</span>
<a name="l00370"></a>00370 <span class="comment"> * Return the pool associated with the current threadkey.</span>
<a name="l00371"></a>00371 <span class="comment"> * @param data The user data associated with the threadkey.</span>
<a name="l00372"></a>00372 <span class="comment"> * @param key The key associated with the data</span>
<a name="l00373"></a>00373 <span class="comment"> * @param threadkey The currently open threadkey.</span>
<a name="l00374"></a>00374 <span class="comment"> */</span>
<a name="l00375"></a>00375 <a class="code" href="group__apr__platform.html#gad7b91b811a172bfa802603c2fb688f98">APR_DECLARE</a>(<a class="code" href="group__apr__errno.html#gaf76ee4543247e9fb3f3546203e590a6c">apr_status_t</a>) <a class="code" href="group__apr__thread__proc.html#gae203664972dfc5c555620ae1788f5b48">apr_threadkey_data_get</a>(<span class="keywordtype">void</span> **data, const <span class="keywordtype">char</span> *key,
<a name="l00376"></a>00376                                                 <a class="code" href="group__apr__thread__proc.html#ga337c9c1bd2d47740022071a5c41f2edb">apr_threadkey_t</a> *threadkey);
<a name="l00377"></a>00377 <span class="comment"></span>
<a name="l00378"></a>00378 <span class="comment">/**</span>
<a name="l00379"></a>00379 <span class="comment"> * Return the pool associated with the current threadkey.</span>
<a name="l00380"></a>00380 <span class="comment"> * @param data The data to set.</span>
<a name="l00381"></a>00381 <span class="comment"> * @param key The key to associate with the data.</span>
<a name="l00382"></a>00382 <span class="comment"> * @param cleanup The cleanup routine to use when the file is destroyed.</span>
<a name="l00383"></a>00383 <span class="comment"> * @param threadkey The currently open threadkey.</span>
<a name="l00384"></a>00384 <span class="comment"> */</span>
<a name="l00385"></a>00385 <a class="code" href="group__apr__platform.html#gad7b91b811a172bfa802603c2fb688f98">APR_DECLARE</a>(<a class="code" href="group__apr__errno.html#gaf76ee4543247e9fb3f3546203e590a6c">apr_status_t</a>) <a class="code" href="group__apr__thread__proc.html#ga1059158f34dded87f21ba82af1211951">apr_threadkey_data_set</a>(<span class="keywordtype">void</span> *data, const <span class="keywordtype">char</span> *key,
<a name="l00386"></a>00386                                                 <a class="code" href="group__apr__errno.html#gaf76ee4543247e9fb3f3546203e590a6c">apr_status_t</a> (*cleanup) (<span class="keywordtype">void</span> *),
<a name="l00387"></a>00387                                                 <a class="code" href="group__apr__thread__proc.html#ga337c9c1bd2d47740022071a5c41f2edb">apr_threadkey_t</a> *threadkey);
<a name="l00388"></a>00388 
<a name="l00389"></a>00389 <span class="preprocessor">#endif</span>
<a name="l00390"></a>00390 <span class="preprocessor"></span><span class="comment"></span>
<a name="l00391"></a>00391 <span class="comment">/**</span>
<a name="l00392"></a>00392 <span class="comment"> * Create and initialize a new procattr variable</span>
<a name="l00393"></a>00393 <span class="comment"> * @param new_attr The newly created procattr. </span>
<a name="l00394"></a>00394 <span class="comment"> * @param cont The pool to use</span>
<a name="l00395"></a>00395 <span class="comment"> */</span>
<a name="l00396"></a>00396 <a class="code" href="group__apr__platform.html#gad7b91b811a172bfa802603c2fb688f98">APR_DECLARE</a>(<a class="code" href="group__apr__errno.html#gaf76ee4543247e9fb3f3546203e590a6c">apr_status_t</a>) <a class="code" href="group__apr__thread__proc.html#ga90f8ef684e601c110daad9b63da53cf3">apr_procattr_create</a>(<a class="code" href="group__apr__thread__proc.html#ga0d83919a6a0dd609598a864917f8b339">apr_procattr_t</a> **new_attr,
<a name="l00397"></a>00397                                                   <a class="code" href="group__apr__pools.html#gaf137f28edcf9a086cd6bc36c20d7cdfb">apr_pool_t</a> *cont);
<a name="l00398"></a>00398 <span class="comment"></span>
<a name="l00399"></a>00399 <span class="comment">/**</span>
<a name="l00400"></a>00400 <span class="comment"> * Determine if any of stdin, stdout, or stderr should be linked to pipes </span>
<a name="l00401"></a>00401 <span class="comment"> * when starting a child process.</span>
<a name="l00402"></a>00402 <span class="comment"> * @param attr The procattr we care about. </span>
<a name="l00403"></a>00403 <span class="comment"> * @param in Should stdin be a pipe back to the parent?</span>
<a name="l00404"></a>00404 <span class="comment"> * @param out Should stdout be a pipe back to the parent?</span>
<a name="l00405"></a>00405 <span class="comment"> * @param err Should stderr be a pipe back to the parent?</span>
<a name="l00406"></a>00406 <span class="comment"> * @note If APR_NO_PIPE, there will be no special channel, the child</span>
<a name="l00407"></a>00407 <span class="comment"> * inherits the parent&#39;s corresponding stdio stream.  If APR_NO_FILE is </span>
<a name="l00408"></a>00408 <span class="comment"> * specified, that corresponding stream is closed in the child (and will</span>
<a name="l00409"></a>00409 <span class="comment"> * be INVALID_HANDLE_VALUE when inspected on Win32). This can have ugly </span>
<a name="l00410"></a>00410 <span class="comment"> * side effects, as the next file opened in the child on Unix will fall</span>
<a name="l00411"></a>00411 <span class="comment"> * into the stdio stream fd slot!</span>
<a name="l00412"></a>00412 <span class="comment"> */</span>
<a name="l00413"></a>00413 <a class="code" href="group__apr__platform.html#gad7b91b811a172bfa802603c2fb688f98">APR_DECLARE</a>(<a class="code" href="group__apr__errno.html#gaf76ee4543247e9fb3f3546203e590a6c">apr_status_t</a>) <a class="code" href="group__apr__thread__proc.html#ga2b1598bc6f5ab0bfcf2e55096d563c98">apr_procattr_io_set</a>(<a class="code" href="group__apr__thread__proc.html#ga0d83919a6a0dd609598a864917f8b339">apr_procattr_t</a> *attr, 
<a name="l00414"></a>00414                                              apr_int32_t in, apr_int32_t out,
<a name="l00415"></a>00415                                              apr_int32_t err);
<a name="l00416"></a>00416 <span class="comment"></span>
<a name="l00417"></a>00417 <span class="comment">/**</span>
<a name="l00418"></a>00418 <span class="comment"> * Set the child_in and/or parent_in values to existing apr_file_t values.</span>
<a name="l00419"></a>00419 <span class="comment"> * @param attr The procattr we care about. </span>
<a name="l00420"></a>00420 <span class="comment"> * @param child_in apr_file_t value to use as child_in. Must be a valid file.</span>
<a name="l00421"></a>00421 <span class="comment"> * @param parent_in apr_file_t value to use as parent_in. Must be a valid file.</span>
<a name="l00422"></a>00422 <span class="comment"> * @remark  This is NOT a required initializer function. This is</span>
<a name="l00423"></a>00423 <span class="comment"> *          useful if you have already opened a pipe (or multiple files)</span>
<a name="l00424"></a>00424 <span class="comment"> *          that you wish to use, perhaps persistently across multiple</span>
<a name="l00425"></a>00425 <span class="comment"> *          process invocations - such as a log file. You can save some </span>
<a name="l00426"></a>00426 <span class="comment"> *          extra function calls by not creating your own pipe since this</span>
<a name="l00427"></a>00427 <span class="comment"> *          creates one in the process space for you.</span>
<a name="l00428"></a>00428 <span class="comment"> * @bug Note that calling this function with two NULL files on some platforms</span>
<a name="l00429"></a>00429 <span class="comment"> * creates an APR_FULL_BLOCK pipe, but this behavior is neither portable nor</span>
<a name="l00430"></a>00430 <span class="comment"> * is it supported.  @see apr_procattr_io_set instead for simple pipes.</span>
<a name="l00431"></a>00431 <span class="comment"> */</span>
<a name="l00432"></a>00432 <a class="code" href="group__apr__platform.html#gad7b91b811a172bfa802603c2fb688f98">APR_DECLARE</a>(<a class="code" href="group__apr__errno.html#gaf76ee4543247e9fb3f3546203e590a6c">apr_status_t</a>) <a class="code" href="group__apr__thread__proc.html#ga24f40119b1aa07dd45a681a44915cb1b">apr_procattr_child_in_set</a>(struct <a class="code" href="group__apr__thread__proc.html#ga0d83919a6a0dd609598a864917f8b339">apr_procattr_t</a> *attr,
<a name="l00433"></a>00433                                                   <a class="code" href="group__apr__file__io.html#gaa46e4763ac375ea3c7a43ba6f6099e22">apr_file_t</a> *child_in,
<a name="l00434"></a>00434                                                   <a class="code" href="group__apr__file__io.html#gaa46e4763ac375ea3c7a43ba6f6099e22">apr_file_t</a> *parent_in);
<a name="l00435"></a>00435 <span class="comment"></span>
<a name="l00436"></a>00436 <span class="comment">/**</span>
<a name="l00437"></a>00437 <span class="comment"> * Set the child_out and parent_out values to existing apr_file_t values.</span>
<a name="l00438"></a>00438 <span class="comment"> * @param attr The procattr we care about. </span>
<a name="l00439"></a>00439 <span class="comment"> * @param child_out apr_file_t value to use as child_out. Must be a valid file.</span>
<a name="l00440"></a>00440 <span class="comment"> * @param parent_out apr_file_t value to use as parent_out. Must be a valid file.</span>
<a name="l00441"></a>00441 <span class="comment"> * @remark This is NOT a required initializer function. This is</span>
<a name="l00442"></a>00442 <span class="comment"> *         useful if you have already opened a pipe (or multiple files)</span>
<a name="l00443"></a>00443 <span class="comment"> *         that you wish to use, perhaps persistently across multiple</span>
<a name="l00444"></a>00444 <span class="comment"> *         process invocations - such as a log file. </span>
<a name="l00445"></a>00445 <span class="comment"> * @bug Note that calling this function with two NULL files on some platforms</span>
<a name="l00446"></a>00446 <span class="comment"> * creates an APR_FULL_BLOCK pipe, but this behavior is neither portable nor</span>
<a name="l00447"></a>00447 <span class="comment"> * is it supported.  @see apr_procattr_io_set instead for simple pipes.</span>
<a name="l00448"></a>00448 <span class="comment"> */</span>
<a name="l00449"></a>00449 <a class="code" href="group__apr__platform.html#gad7b91b811a172bfa802603c2fb688f98">APR_DECLARE</a>(<a class="code" href="group__apr__errno.html#gaf76ee4543247e9fb3f3546203e590a6c">apr_status_t</a>) <a class="code" href="group__apr__thread__proc.html#gabb97e9a49021ab4452ae3f1a281c977f">apr_procattr_child_out_set</a>(struct <a class="code" href="group__apr__thread__proc.html#ga0d83919a6a0dd609598a864917f8b339">apr_procattr_t</a> *attr,
<a name="l00450"></a>00450                                                    <a class="code" href="group__apr__file__io.html#gaa46e4763ac375ea3c7a43ba6f6099e22">apr_file_t</a> *child_out,
<a name="l00451"></a>00451                                                    <a class="code" href="group__apr__file__io.html#gaa46e4763ac375ea3c7a43ba6f6099e22">apr_file_t</a> *parent_out);
<a name="l00452"></a>00452 <span class="comment"></span>
<a name="l00453"></a>00453 <span class="comment">/**</span>
<a name="l00454"></a>00454 <span class="comment"> * Set the child_err and parent_err values to existing apr_file_t values.</span>
<a name="l00455"></a>00455 <span class="comment"> * @param attr The procattr we care about. </span>
<a name="l00456"></a>00456 <span class="comment"> * @param child_err apr_file_t value to use as child_err. Must be a valid file.</span>
<a name="l00457"></a>00457 <span class="comment"> * @param parent_err apr_file_t value to use as parent_err. Must be a valid file.</span>
<a name="l00458"></a>00458 <span class="comment"> * @remark This is NOT a required initializer function. This is</span>
<a name="l00459"></a>00459 <span class="comment"> *         useful if you have already opened a pipe (or multiple files)</span>
<a name="l00460"></a>00460 <span class="comment"> *         that you wish to use, perhaps persistently across multiple</span>
<a name="l00461"></a>00461 <span class="comment"> *         process invocations - such as a log file. </span>
<a name="l00462"></a>00462 <span class="comment"> * @bug Note that calling this function with two NULL files on some platforms</span>
<a name="l00463"></a>00463 <span class="comment"> * creates an APR_FULL_BLOCK pipe, but this behavior is neither portable nor</span>
<a name="l00464"></a>00464 <span class="comment"> * is it supported.  @see apr_procattr_io_set instead for simple pipes.</span>
<a name="l00465"></a>00465 <span class="comment"> */</span>
<a name="l00466"></a>00466 <a class="code" href="group__apr__platform.html#gad7b91b811a172bfa802603c2fb688f98">APR_DECLARE</a>(<a class="code" href="group__apr__errno.html#gaf76ee4543247e9fb3f3546203e590a6c">apr_status_t</a>) <a class="code" href="group__apr__thread__proc.html#ga6fad364c6c820e37c0915435cfb3921f">apr_procattr_child_err_set</a>(struct <a class="code" href="group__apr__thread__proc.html#ga0d83919a6a0dd609598a864917f8b339">apr_procattr_t</a> *attr,
<a name="l00467"></a>00467                                                    <a class="code" href="group__apr__file__io.html#gaa46e4763ac375ea3c7a43ba6f6099e22">apr_file_t</a> *child_err,
<a name="l00468"></a>00468                                                    <a class="code" href="group__apr__file__io.html#gaa46e4763ac375ea3c7a43ba6f6099e22">apr_file_t</a> *parent_err);
<a name="l00469"></a>00469 <span class="comment"></span>
<a name="l00470"></a>00470 <span class="comment">/**</span>
<a name="l00471"></a>00471 <span class="comment"> * Set which directory the child process should start executing in.</span>
<a name="l00472"></a>00472 <span class="comment"> * @param attr The procattr we care about. </span>
<a name="l00473"></a>00473 <span class="comment"> * @param dir Which dir to start in.  By default, this is the same dir as</span>
<a name="l00474"></a>00474 <span class="comment"> *            the parent currently resides in, when the createprocess call</span>
<a name="l00475"></a>00475 <span class="comment"> *            is made. </span>
<a name="l00476"></a>00476 <span class="comment"> */</span>
<a name="l00477"></a>00477 <a class="code" href="group__apr__platform.html#gad7b91b811a172bfa802603c2fb688f98">APR_DECLARE</a>(<a class="code" href="group__apr__errno.html#gaf76ee4543247e9fb3f3546203e590a6c">apr_status_t</a>) <a class="code" href="group__apr__thread__proc.html#ga97766f50b0ae083a2f8a28e698a59baa">apr_procattr_dir_set</a>(<a class="code" href="group__apr__thread__proc.html#ga0d83919a6a0dd609598a864917f8b339">apr_procattr_t</a> *attr, 
<a name="l00478"></a>00478                                               const <span class="keywordtype">char</span> *dir);
<a name="l00479"></a>00479 <span class="comment"></span>
<a name="l00480"></a>00480 <span class="comment">/**</span>
<a name="l00481"></a>00481 <span class="comment"> * Set what type of command the child process will call.</span>
<a name="l00482"></a>00482 <span class="comment"> * @param attr The procattr we care about. </span>
<a name="l00483"></a>00483 <span class="comment"> * @param cmd The type of command.  One of:</span>
<a name="l00484"></a>00484 <span class="comment"> * &lt;PRE&gt;</span>
<a name="l00485"></a>00485 <span class="comment"> *            APR_SHELLCMD     --  Anything that the shell can handle</span>
<a name="l00486"></a>00486 <span class="comment"> *            APR_PROGRAM      --  Executable program   (default) </span>
<a name="l00487"></a>00487 <span class="comment"> *            APR_PROGRAM_ENV  --  Executable program, copy environment</span>
<a name="l00488"></a>00488 <span class="comment"> *            APR_PROGRAM_PATH --  Executable program on PATH, copy env</span>
<a name="l00489"></a>00489 <span class="comment"> * &lt;/PRE&gt;</span>
<a name="l00490"></a>00490 <span class="comment"> */</span>
<a name="l00491"></a>00491 <a class="code" href="group__apr__platform.html#gad7b91b811a172bfa802603c2fb688f98">APR_DECLARE</a>(<a class="code" href="group__apr__errno.html#gaf76ee4543247e9fb3f3546203e590a6c">apr_status_t</a>) <a class="code" href="group__apr__thread__proc.html#ga1426acc5bdd96385769e7b42bfa6ebbd">apr_procattr_cmdtype_set</a>(<a class="code" href="group__apr__thread__proc.html#ga0d83919a6a0dd609598a864917f8b339">apr_procattr_t</a> *attr,
<a name="l00492"></a>00492                                                   <a class="code" href="group__apr__thread__proc.html#gadcb981d7748c580eb69ac11dbf709060">apr_cmdtype_e</a> cmd);
<a name="l00493"></a>00493 <span class="comment"></span>
<a name="l00494"></a>00494 <span class="comment">/**</span>
<a name="l00495"></a>00495 <span class="comment"> * Determine if the child should start in detached state.</span>
<a name="l00496"></a>00496 <span class="comment"> * @param attr The procattr we care about. </span>
<a name="l00497"></a>00497 <span class="comment"> * @param detach Should the child start in detached state?  Default is no. </span>
<a name="l00498"></a>00498 <span class="comment"> */</span>
<a name="l00499"></a>00499 <a class="code" href="group__apr__platform.html#gad7b91b811a172bfa802603c2fb688f98">APR_DECLARE</a>(<a class="code" href="group__apr__errno.html#gaf76ee4543247e9fb3f3546203e590a6c">apr_status_t</a>) <a class="code" href="group__apr__thread__proc.html#ga3ccca55041f648f00f0605673d4e0fdc">apr_procattr_detach_set</a>(<a class="code" href="group__apr__thread__proc.html#ga0d83919a6a0dd609598a864917f8b339">apr_procattr_t</a> *attr, 
<a name="l00500"></a>00500                                                  apr_int32_t detach);
<a name="l00501"></a>00501 
<a name="l00502"></a>00502 <span class="preprocessor">#if APR_HAVE_STRUCT_RLIMIT</span>
<a name="l00503"></a>00503 <span class="preprocessor"></span><span class="comment">/**</span>
<a name="l00504"></a>00504 <span class="comment"> * Set the Resource Utilization limits when starting a new process.</span>
<a name="l00505"></a>00505 <span class="comment"> * @param attr The procattr we care about. </span>
<a name="l00506"></a>00506 <span class="comment"> * @param what Which limit to set, one of:</span>
<a name="l00507"></a>00507 <span class="comment"> * &lt;PRE&gt;</span>
<a name="l00508"></a>00508 <span class="comment"> *                 APR_LIMIT_CPU</span>
<a name="l00509"></a>00509 <span class="comment"> *                 APR_LIMIT_MEM</span>
<a name="l00510"></a>00510 <span class="comment"> *                 APR_LIMIT_NPROC</span>
<a name="l00511"></a>00511 <span class="comment"> *                 APR_LIMIT_NOFILE</span>
<a name="l00512"></a>00512 <span class="comment"> * &lt;/PRE&gt;</span>
<a name="l00513"></a>00513 <span class="comment"> * @param limit Value to set the limit to.</span>
<a name="l00514"></a>00514 <span class="comment"> */</span>
<a name="l00515"></a>00515 <a class="code" href="group__apr__platform.html#gad7b91b811a172bfa802603c2fb688f98">APR_DECLARE</a>(<a class="code" href="group__apr__errno.html#gaf76ee4543247e9fb3f3546203e590a6c">apr_status_t</a>) <a class="code" href="group__apr__thread__proc.html#ga4de85cfd54d27476dbb943955c1b0a2a">apr_procattr_limit_set</a>(<a class="code" href="group__apr__thread__proc.html#ga0d83919a6a0dd609598a864917f8b339">apr_procattr_t</a> *attr, 
<a name="l00516"></a>00516                                                 apr_int32_t what,
<a name="l00517"></a>00517                                                 struct rlimit *limit);
<a name="l00518"></a>00518 <span class="preprocessor">#endif</span>
<a name="l00519"></a>00519 <span class="preprocessor"></span><span class="comment"></span>
<a name="l00520"></a>00520 <span class="comment">/**</span>
<a name="l00521"></a>00521 <span class="comment"> * Specify an error function to be called in the child process if APR</span>
<a name="l00522"></a>00522 <span class="comment"> * encounters an error in the child prior to running the specified program.</span>
<a name="l00523"></a>00523 <span class="comment"> * @param attr The procattr describing the child process to be created.</span>
<a name="l00524"></a>00524 <span class="comment"> * @param errfn The function to call in the child process.</span>
<a name="l00525"></a>00525 <span class="comment"> * @remark At the present time, it will only be called from apr_proc_create()</span>
<a name="l00526"></a>00526 <span class="comment"> *         on platforms where fork() is used.  It will never be called on other</span>
<a name="l00527"></a>00527 <span class="comment"> *         platforms, on those platforms apr_proc_create() will return the error</span>
<a name="l00528"></a>00528 <span class="comment"> *         in the parent process rather than invoke the callback in the now-forked</span>
<a name="l00529"></a>00529 <span class="comment"> *         child process.</span>
<a name="l00530"></a>00530 <span class="comment"> */</span>
<a name="l00531"></a>00531 <a class="code" href="group__apr__platform.html#gad7b91b811a172bfa802603c2fb688f98">APR_DECLARE</a>(<a class="code" href="group__apr__errno.html#gaf76ee4543247e9fb3f3546203e590a6c">apr_status_t</a>) <a class="code" href="group__apr__thread__proc.html#gaa39deba0837e0772754ad41589b733cf">apr_procattr_child_errfn_set</a>(<a class="code" href="group__apr__thread__proc.html#ga0d83919a6a0dd609598a864917f8b339">apr_procattr_t</a> *attr,
<a name="l00532"></a>00532                                                        <a class="code" href="group__apr__thread__proc.html#ga8f8642f468f05b0ac2b1426b723af100">apr_child_errfn_t</a> *errfn);
<a name="l00533"></a>00533 <span class="comment"></span>
<a name="l00534"></a>00534 <span class="comment">/**</span>
<a name="l00535"></a>00535 <span class="comment"> * Specify that apr_proc_create() should do whatever it can to report</span>
<a name="l00536"></a>00536 <span class="comment"> * failures to the caller of apr_proc_create(), rather than find out in</span>
<a name="l00537"></a>00537 <span class="comment"> * the child.</span>
<a name="l00538"></a>00538 <span class="comment"> * @param attr The procattr describing the child process to be created.</span>
<a name="l00539"></a>00539 <span class="comment"> * @param chk Flag to indicate whether or not extra work should be done</span>
<a name="l00540"></a>00540 <span class="comment"> *            to try to report failures to the caller.</span>
<a name="l00541"></a>00541 <span class="comment"> * @remark This flag only affects apr_proc_create() on platforms where</span>
<a name="l00542"></a>00542 <span class="comment"> *         fork() is used.  This leads to extra overhead in the calling</span>
<a name="l00543"></a>00543 <span class="comment"> *         process, but that may help the application handle such</span>
<a name="l00544"></a>00544 <span class="comment"> *         errors more gracefully.</span>
<a name="l00545"></a>00545 <span class="comment"> */</span>
<a name="l00546"></a>00546 <a class="code" href="group__apr__platform.html#gad7b91b811a172bfa802603c2fb688f98">APR_DECLARE</a>(<a class="code" href="group__apr__errno.html#gaf76ee4543247e9fb3f3546203e590a6c">apr_status_t</a>) <a class="code" href="group__apr__thread__proc.html#ga24076f050e9385af09ad8c3931d8dc43">apr_procattr_error_check_set</a>(<a class="code" href="group__apr__thread__proc.html#ga0d83919a6a0dd609598a864917f8b339">apr_procattr_t</a> *attr,
<a name="l00547"></a>00547                                                        apr_int32_t chk);
<a name="l00548"></a>00548 <span class="comment"></span>
<a name="l00549"></a>00549 <span class="comment">/**</span>
<a name="l00550"></a>00550 <span class="comment"> * Determine if the child should start in its own address space or using the </span>
<a name="l00551"></a>00551 <span class="comment"> * current one from its parent</span>
<a name="l00552"></a>00552 <span class="comment"> * @param attr The procattr we care about. </span>
<a name="l00553"></a>00553 <span class="comment"> * @param addrspace Should the child start in its own address space?  Default</span>
<a name="l00554"></a>00554 <span class="comment"> *                  is no on NetWare and yes on other platforms.</span>
<a name="l00555"></a>00555 <span class="comment"> */</span>
<a name="l00556"></a>00556 <a class="code" href="group__apr__platform.html#gad7b91b811a172bfa802603c2fb688f98">APR_DECLARE</a>(<a class="code" href="group__apr__errno.html#gaf76ee4543247e9fb3f3546203e590a6c">apr_status_t</a>) <a class="code" href="group__apr__thread__proc.html#ga0f1dd02408995767efcb9c0d9c775620">apr_procattr_addrspace_set</a>(<a class="code" href="group__apr__thread__proc.html#ga0d83919a6a0dd609598a864917f8b339">apr_procattr_t</a> *attr,
<a name="l00557"></a>00557                                                        apr_int32_t addrspace);
<a name="l00558"></a>00558 <span class="comment"></span>
<a name="l00559"></a>00559 <span class="comment">/**</span>
<a name="l00560"></a>00560 <span class="comment"> * Set the username used for running process</span>
<a name="l00561"></a>00561 <span class="comment"> * @param attr The procattr we care about. </span>
<a name="l00562"></a>00562 <span class="comment"> * @param username The username used</span>
<a name="l00563"></a>00563 <span class="comment"> * @param password User password if needed. Password is needed on WIN32</span>
<a name="l00564"></a>00564 <span class="comment"> *                 or any other platform having</span>
<a name="l00565"></a>00565 <span class="comment"> *                 APR_PROCATTR_USER_SET_REQUIRES_PASSWORD set.</span>
<a name="l00566"></a>00566 <span class="comment"> */</span>
<a name="l00567"></a>00567 <a class="code" href="group__apr__platform.html#gad7b91b811a172bfa802603c2fb688f98">APR_DECLARE</a>(<a class="code" href="group__apr__errno.html#gaf76ee4543247e9fb3f3546203e590a6c">apr_status_t</a>) <a class="code" href="group__apr__thread__proc.html#ga741ed3dc047b935b091a21528c49bb19">apr_procattr_user_set</a>(<a class="code" href="group__apr__thread__proc.html#ga0d83919a6a0dd609598a864917f8b339">apr_procattr_t</a> *attr,
<a name="l00568"></a>00568                                                 const <span class="keywordtype">char</span> *username,
<a name="l00569"></a>00569                                                 const <span class="keywordtype">char</span> *password);
<a name="l00570"></a>00570 <span class="comment"></span>
<a name="l00571"></a>00571 <span class="comment">/**</span>
<a name="l00572"></a>00572 <span class="comment"> * Set the group used for running process</span>
<a name="l00573"></a>00573 <span class="comment"> * @param attr The procattr we care about. </span>
<a name="l00574"></a>00574 <span class="comment"> * @param groupname The group name  used</span>
<a name="l00575"></a>00575 <span class="comment"> */</span>
<a name="l00576"></a>00576 <a class="code" href="group__apr__platform.html#gad7b91b811a172bfa802603c2fb688f98">APR_DECLARE</a>(<a class="code" href="group__apr__errno.html#gaf76ee4543247e9fb3f3546203e590a6c">apr_status_t</a>) <a class="code" href="group__apr__thread__proc.html#ga391f0d3831a5894ea2118762789a395d">apr_procattr_group_set</a>(<a class="code" href="group__apr__thread__proc.html#ga0d83919a6a0dd609598a864917f8b339">apr_procattr_t</a> *attr,
<a name="l00577"></a>00577                                                  const <span class="keywordtype">char</span> *groupname);
<a name="l00578"></a>00578 
<a name="l00579"></a>00579 
<a name="l00580"></a>00580 <span class="preprocessor">#if APR_HAS_FORK</span>
<a name="l00581"></a>00581 <span class="preprocessor"></span><span class="comment">/**</span>
<a name="l00582"></a>00582 <span class="comment"> * This is currently the only non-portable call in APR.  This executes </span>
<a name="l00583"></a>00583 <span class="comment"> * a standard unix fork.</span>
<a name="l00584"></a>00584 <span class="comment"> * @param proc The resulting process handle. </span>
<a name="l00585"></a>00585 <span class="comment"> * @param cont The pool to use. </span>
<a name="l00586"></a>00586 <span class="comment"> * @remark returns APR_INCHILD for the child, and APR_INPARENT for the parent</span>
<a name="l00587"></a>00587 <span class="comment"> * or an error.</span>
<a name="l00588"></a>00588 <span class="comment"> */</span>
<a name="l00589"></a>00589 <a class="code" href="group__apr__platform.html#gad7b91b811a172bfa802603c2fb688f98">APR_DECLARE</a>(<a class="code" href="group__apr__errno.html#gaf76ee4543247e9fb3f3546203e590a6c">apr_status_t</a>) <a class="code" href="group__apr__thread__proc.html#ga3d0415bf69b0a629a929833e82758b85">apr_proc_fork</a>(<a class="code" href="structapr__proc__t.html">apr_proc_t</a> *proc, <a class="code" href="group__apr__pools.html#gaf137f28edcf9a086cd6bc36c20d7cdfb">apr_pool_t</a> *cont);
<a name="l00590"></a>00590 <span class="preprocessor">#endif</span>
<a name="l00591"></a>00591 <span class="preprocessor"></span><span class="comment"></span>
<a name="l00592"></a>00592 <span class="comment">/**</span>
<a name="l00593"></a>00593 <span class="comment"> * Create a new process and execute a new program within that process.</span>
<a name="l00594"></a>00594 <span class="comment"> * @param new_proc The resulting process handle.</span>
<a name="l00595"></a>00595 <span class="comment"> * @param progname The program to run </span>
<a name="l00596"></a>00596 <span class="comment"> * @param args the arguments to pass to the new program.  The first </span>
<a name="l00597"></a>00597 <span class="comment"> *             one should be the program name.</span>
<a name="l00598"></a>00598 <span class="comment"> * @param env The new environment table for the new process.  This </span>
<a name="l00599"></a>00599 <span class="comment"> *            should be a list of NULL-terminated strings. This argument</span>
<a name="l00600"></a>00600 <span class="comment"> *            is ignored for APR_PROGRAM_ENV, APR_PROGRAM_PATH, and</span>
<a name="l00601"></a>00601 <span class="comment"> *            APR_SHELLCMD_ENV types of commands.</span>
<a name="l00602"></a>00602 <span class="comment"> * @param attr the procattr we should use to determine how to create the new</span>
<a name="l00603"></a>00603 <span class="comment"> *         process</span>
<a name="l00604"></a>00604 <span class="comment"> * @param pool The pool to use.</span>
<a name="l00605"></a>00605 <span class="comment"> * @note This function returns without waiting for the new process to terminate;</span>
<a name="l00606"></a>00606 <span class="comment"> * use apr_proc_wait for that.</span>
<a name="l00607"></a>00607 <span class="comment"> */</span>
<a name="l00608"></a>00608 <a class="code" href="group__apr__platform.html#gad7b91b811a172bfa802603c2fb688f98">APR_DECLARE</a>(<a class="code" href="group__apr__errno.html#gaf76ee4543247e9fb3f3546203e590a6c">apr_status_t</a>) <a class="code" href="group__apr__thread__proc.html#gab51dd90b98d365a969f0ec5c7bef4e14">apr_proc_create</a>(<a class="code" href="structapr__proc__t.html">apr_proc_t</a> *new_proc,
<a name="l00609"></a>00609                                           const <span class="keywordtype">char</span> *progname,
<a name="l00610"></a>00610                                           const <span class="keywordtype">char</span> * const *args,
<a name="l00611"></a>00611                                           const <span class="keywordtype">char</span> * const *env, 
<a name="l00612"></a>00612                                           <a class="code" href="group__apr__thread__proc.html#ga0d83919a6a0dd609598a864917f8b339">apr_procattr_t</a> *attr, 
<a name="l00613"></a>00613                                           <a class="code" href="group__apr__pools.html#gaf137f28edcf9a086cd6bc36c20d7cdfb">apr_pool_t</a> *pool);
<a name="l00614"></a>00614 <span class="comment"></span>
<a name="l00615"></a>00615 <span class="comment">/**</span>
<a name="l00616"></a>00616 <span class="comment"> * Wait for a child process to die</span>
<a name="l00617"></a>00617 <span class="comment"> * @param proc The process handle that corresponds to the desired child process </span>
<a name="l00618"></a>00618 <span class="comment"> * @param exitcode The returned exit status of the child, if a child process </span>
<a name="l00619"></a>00619 <span class="comment"> *                 dies, or the signal that caused the child to die.</span>
<a name="l00620"></a>00620 <span class="comment"> *                 On platforms that don&#39;t support obtaining this information, </span>
<a name="l00621"></a>00621 <span class="comment"> *                 the status parameter will be returned as APR_ENOTIMPL.</span>
<a name="l00622"></a>00622 <span class="comment"> * @param exitwhy Why the child died, the bitwise or of:</span>
<a name="l00623"></a>00623 <span class="comment"> * &lt;PRE&gt;</span>
<a name="l00624"></a>00624 <span class="comment"> *            APR_PROC_EXIT         -- process terminated normally</span>
<a name="l00625"></a>00625 <span class="comment"> *            APR_PROC_SIGNAL       -- process was killed by a signal</span>
<a name="l00626"></a>00626 <span class="comment"> *            APR_PROC_SIGNAL_CORE  -- process was killed by a signal, and</span>
<a name="l00627"></a>00627 <span class="comment"> *                                     generated a core dump.</span>
<a name="l00628"></a>00628 <span class="comment"> * &lt;/PRE&gt;</span>
<a name="l00629"></a>00629 <span class="comment"> * @param waithow How should we wait.  One of:</span>
<a name="l00630"></a>00630 <span class="comment"> * &lt;PRE&gt;</span>
<a name="l00631"></a>00631 <span class="comment"> *            APR_WAIT   -- block until the child process dies.</span>
<a name="l00632"></a>00632 <span class="comment"> *            APR_NOWAIT -- return immediately regardless of if the </span>
<a name="l00633"></a>00633 <span class="comment"> *                          child is dead or not.</span>
<a name="l00634"></a>00634 <span class="comment"> * &lt;/PRE&gt;</span>
<a name="l00635"></a>00635 <span class="comment"> * @remark The childs status is in the return code to this process.  It is one of:</span>
<a name="l00636"></a>00636 <span class="comment"> * &lt;PRE&gt;</span>
<a name="l00637"></a>00637 <span class="comment"> *            APR_CHILD_DONE     -- child is no longer running.</span>
<a name="l00638"></a>00638 <span class="comment"> *            APR_CHILD_NOTDONE  -- child is still running.</span>
<a name="l00639"></a>00639 <span class="comment"> * &lt;/PRE&gt;</span>
<a name="l00640"></a>00640 <span class="comment"> */</span>
<a name="l00641"></a>00641 <a class="code" href="group__apr__platform.html#gad7b91b811a172bfa802603c2fb688f98">APR_DECLARE</a>(<a class="code" href="group__apr__errno.html#gaf76ee4543247e9fb3f3546203e590a6c">apr_status_t</a>) <a class="code" href="group__apr__thread__proc.html#ga0936f7a7fe7e2d5e08979c9f343a5a1b">apr_proc_wait</a>(<a class="code" href="structapr__proc__t.html">apr_proc_t</a> *proc,
<a name="l00642"></a>00642                                         <span class="keywordtype">int</span> *exitcode, <a class="code" href="group__apr__thread__proc.html#gac097b4fa41e67024711c5983446d0951">apr_exit_why_e</a> *exitwhy,
<a name="l00643"></a>00643                                         <a class="code" href="group__apr__thread__proc.html#ga5e52d786644f3b66d6180571e68c7260">apr_wait_how_e</a> waithow);
<a name="l00644"></a>00644 <span class="comment"></span>
<a name="l00645"></a>00645 <span class="comment">/**</span>
<a name="l00646"></a>00646 <span class="comment"> * Wait for any current child process to die and return information </span>
<a name="l00647"></a>00647 <span class="comment"> * about that child.</span>
<a name="l00648"></a>00648 <span class="comment"> * @param proc Pointer to NULL on entry, will be filled out with child&#39;s </span>
<a name="l00649"></a>00649 <span class="comment"> *             information </span>
<a name="l00650"></a>00650 <span class="comment"> * @param exitcode The returned exit status of the child, if a child process </span>
<a name="l00651"></a>00651 <span class="comment"> *                 dies, or the signal that caused the child to die.</span>
<a name="l00652"></a>00652 <span class="comment"> *                 On platforms that don&#39;t support obtaining this information, </span>
<a name="l00653"></a>00653 <span class="comment"> *                 the status parameter will be returned as APR_ENOTIMPL.</span>
<a name="l00654"></a>00654 <span class="comment"> * @param exitwhy Why the child died, the bitwise or of:</span>
<a name="l00655"></a>00655 <span class="comment"> * &lt;PRE&gt;</span>
<a name="l00656"></a>00656 <span class="comment"> *            APR_PROC_EXIT         -- process terminated normally</span>
<a name="l00657"></a>00657 <span class="comment"> *            APR_PROC_SIGNAL       -- process was killed by a signal</span>
<a name="l00658"></a>00658 <span class="comment"> *            APR_PROC_SIGNAL_CORE  -- process was killed by a signal, and</span>
<a name="l00659"></a>00659 <span class="comment"> *                                     generated a core dump.</span>
<a name="l00660"></a>00660 <span class="comment"> * &lt;/PRE&gt;</span>
<a name="l00661"></a>00661 <span class="comment"> * @param waithow How should we wait.  One of:</span>
<a name="l00662"></a>00662 <span class="comment"> * &lt;PRE&gt;</span>
<a name="l00663"></a>00663 <span class="comment"> *            APR_WAIT   -- block until the child process dies.</span>
<a name="l00664"></a>00664 <span class="comment"> *            APR_NOWAIT -- return immediately regardless of if the </span>
<a name="l00665"></a>00665 <span class="comment"> *                          child is dead or not.</span>
<a name="l00666"></a>00666 <span class="comment"> * &lt;/PRE&gt;</span>
<a name="l00667"></a>00667 <span class="comment"> * @param p Pool to allocate child information out of.</span>
<a name="l00668"></a>00668 <span class="comment"> * @bug Passing proc as a *proc rather than **proc was an odd choice</span>
<a name="l00669"></a>00669 <span class="comment"> * for some platforms... this should be revisited in 1.0</span>
<a name="l00670"></a>00670 <span class="comment"> */</span>
<a name="l00671"></a>00671 <a class="code" href="group__apr__platform.html#gad7b91b811a172bfa802603c2fb688f98">APR_DECLARE</a>(<a class="code" href="group__apr__errno.html#gaf76ee4543247e9fb3f3546203e590a6c">apr_status_t</a>) <a class="code" href="group__apr__thread__proc.html#ga506183074e8413c3ff597539e4768ea4">apr_proc_wait_all_procs</a>(<a class="code" href="structapr__proc__t.html">apr_proc_t</a> *proc,
<a name="l00672"></a>00672                                                   <span class="keywordtype">int</span> *exitcode,
<a name="l00673"></a>00673                                                   <a class="code" href="group__apr__thread__proc.html#gac097b4fa41e67024711c5983446d0951">apr_exit_why_e</a> *exitwhy,
<a name="l00674"></a>00674                                                   <a class="code" href="group__apr__thread__proc.html#ga5e52d786644f3b66d6180571e68c7260">apr_wait_how_e</a> waithow,
<a name="l00675"></a>00675                                                   <a class="code" href="group__apr__pools.html#gaf137f28edcf9a086cd6bc36c20d7cdfb">apr_pool_t</a> *p);
<a name="l00676"></a>00676 
<a name="l00677"></a><a class="code" href="group__apr__thread__proc.html#gab57b448a464ac299c03d6127781df152">00677</a> <span class="preprocessor">#define APR_PROC_DETACH_FOREGROUND 0    </span><span class="comment">/**&lt; Do not detach */</span>
<a name="l00678"></a><a class="code" href="group__apr__thread__proc.html#gab4de7134fcc66c4127ae65b68631f846">00678</a> <span class="preprocessor">#define APR_PROC_DETACH_DAEMONIZE 1     </span><span class="comment">/**&lt; Detach */</span>
<a name="l00679"></a>00679 <span class="comment"></span>
<a name="l00680"></a>00680 <span class="comment">/**</span>
<a name="l00681"></a>00681 <span class="comment"> * Detach the process from the controlling terminal.</span>
<a name="l00682"></a>00682 <span class="comment"> * @param daemonize set to non-zero if the process should daemonize</span>
<a name="l00683"></a>00683 <span class="comment"> *                  and become a background process, else it will</span>
<a name="l00684"></a>00684 <span class="comment"> *                  stay in the foreground.</span>
<a name="l00685"></a>00685 <span class="comment"> */</span>
<a name="l00686"></a>00686 <a class="code" href="group__apr__platform.html#gad7b91b811a172bfa802603c2fb688f98">APR_DECLARE</a>(<a class="code" href="group__apr__errno.html#gaf76ee4543247e9fb3f3546203e590a6c">apr_status_t</a>) <a class="code" href="group__apr__thread__proc.html#ga56c2b005792752b63d804f2021596406">apr_proc_detach</a>(<span class="keywordtype">int</span> daemonize);
<a name="l00687"></a>00687 <span class="comment"></span>
<a name="l00688"></a>00688 <span class="comment">/**</span>
<a name="l00689"></a>00689 <span class="comment"> * Register an other_child -- a child associated to its registered </span>
<a name="l00690"></a>00690 <span class="comment"> * maintence callback.  This callback is invoked when the process</span>
<a name="l00691"></a>00691 <span class="comment"> * dies, is disconnected or disappears.</span>
<a name="l00692"></a>00692 <span class="comment"> * @param proc The child process to register.</span>
<a name="l00693"></a>00693 <span class="comment"> * @param maintenance maintenance is a function that is invoked with a </span>
<a name="l00694"></a>00694 <span class="comment"> *                    reason and the data pointer passed here.</span>
<a name="l00695"></a>00695 <span class="comment"> * @param data Opaque context data passed to the maintenance function.</span>
<a name="l00696"></a>00696 <span class="comment"> * @param write_fd An fd that is probed for writing.  If it is ever unwritable</span>
<a name="l00697"></a>00697 <span class="comment"> *                 then the maintenance is invoked with reason </span>
<a name="l00698"></a>00698 <span class="comment"> *                 OC_REASON_UNWRITABLE.</span>
<a name="l00699"></a>00699 <span class="comment"> * @param p The pool to use for allocating memory.</span>
<a name="l00700"></a>00700 <span class="comment"> * @bug write_fd duplicates the proc-&gt;out stream, it&#39;s really redundant</span>
<a name="l00701"></a>00701 <span class="comment"> * and should be replaced in the APR 1.0 API with a bitflag of which</span>
<a name="l00702"></a>00702 <span class="comment"> * proc-&gt;in/out/err handles should be health checked.</span>
<a name="l00703"></a>00703 <span class="comment"> * @bug no platform currently tests the pipes health.</span>
<a name="l00704"></a>00704 <span class="comment"> */</span>
<a name="l00705"></a>00705 <a class="code" href="group__apr__platform.html#gad7b91b811a172bfa802603c2fb688f98">APR_DECLARE</a>(<span class="keywordtype">void</span>) <a class="code" href="group__apr__thread__proc.html#gaf8d2be452a819161aa4cd6205a17761e">apr_proc_other_child_register</a>(<a class="code" href="structapr__proc__t.html">apr_proc_t</a> *proc, 
<a name="l00706"></a>00706                                            <span class="keywordtype">void</span> (*maintenance) (<span class="keywordtype">int</span> reason, 
<a name="l00707"></a>00707                                                                 <span class="keywordtype">void</span> *, 
<a name="l00708"></a>00708                                                                 <span class="keywordtype">int</span> status),
<a name="l00709"></a>00709                                            <span class="keywordtype">void</span> *data, <a class="code" href="group__apr__file__io.html#gaa46e4763ac375ea3c7a43ba6f6099e22">apr_file_t</a> *write_fd,
<a name="l00710"></a>00710                                            <a class="code" href="group__apr__pools.html#gaf137f28edcf9a086cd6bc36c20d7cdfb">apr_pool_t</a> *p);
<a name="l00711"></a>00711 <span class="comment"></span>
<a name="l00712"></a>00712 <span class="comment">/**</span>
<a name="l00713"></a>00713 <span class="comment"> * Stop watching the specified other child.  </span>
<a name="l00714"></a>00714 <span class="comment"> * @param data The data to pass to the maintenance function.  This is</span>
<a name="l00715"></a>00715 <span class="comment"> *             used to find the process to unregister.</span>
<a name="l00716"></a>00716 <span class="comment"> * @warning Since this can be called by a maintenance function while we&#39;re</span>
<a name="l00717"></a>00717 <span class="comment"> *          scanning the other_children list, all scanners should protect </span>
<a name="l00718"></a>00718 <span class="comment"> *          themself by loading ocr-&gt;next before calling any maintenance </span>
<a name="l00719"></a>00719 <span class="comment"> *          function.</span>
<a name="l00720"></a>00720 <span class="comment"> */</span>
<a name="l00721"></a>00721 <a class="code" href="group__apr__platform.html#gad7b91b811a172bfa802603c2fb688f98">APR_DECLARE</a>(<span class="keywordtype">void</span>) <a class="code" href="group__apr__thread__proc.html#ga10b1a4b224566c03c97f100ac8a2c830">apr_proc_other_child_unregister</a>(<span class="keywordtype">void</span> *data);
<a name="l00722"></a>00722 <span class="comment"></span>
<a name="l00723"></a>00723 <span class="comment">/**</span>
<a name="l00724"></a>00724 <span class="comment"> * Notify the maintenance callback of a registered other child process</span>
<a name="l00725"></a>00725 <span class="comment"> * that application has detected an event, such as death.</span>
<a name="l00726"></a>00726 <span class="comment"> * @param proc The process to check</span>
<a name="l00727"></a>00727 <span class="comment"> * @param reason The reason code to pass to the maintenance function</span>
<a name="l00728"></a>00728 <span class="comment"> * @param status The status to pass to the maintenance function</span>
<a name="l00729"></a>00729 <span class="comment"> * @remark An example of code using this behavior;</span>
<a name="l00730"></a>00730 <span class="comment"> * &lt;pre&gt;</span>
<a name="l00731"></a>00731 <span class="comment"> * rv = apr_proc_wait_all_procs(&amp;proc, &amp;exitcode, &amp;status, APR_WAIT, p);</span>
<a name="l00732"></a>00732 <span class="comment"> * if (APR_STATUS_IS_CHILD_DONE(rv)) {</span>
<a name="l00733"></a>00733 <span class="comment"> * \#if APR_HAS_OTHER_CHILD</span>
<a name="l00734"></a>00734 <span class="comment"> *     if (apr_proc_other_child_alert(&amp;proc, APR_OC_REASON_DEATH, status)</span>
<a name="l00735"></a>00735 <span class="comment"> *             == APR_SUCCESS) {</span>
<a name="l00736"></a>00736 <span class="comment"> *         ;  (already handled)</span>
<a name="l00737"></a>00737 <span class="comment"> *     }</span>
<a name="l00738"></a>00738 <span class="comment"> *     else</span>
<a name="l00739"></a>00739 <span class="comment"> * \#endif</span>
<a name="l00740"></a>00740 <span class="comment"> *         [... handling non-otherchild processes death ...]</span>
<a name="l00741"></a>00741 <span class="comment"> * &lt;/pre&gt;</span>
<a name="l00742"></a>00742 <span class="comment"> */</span>
<a name="l00743"></a>00743 <a class="code" href="group__apr__platform.html#gad7b91b811a172bfa802603c2fb688f98">APR_DECLARE</a>(<a class="code" href="group__apr__errno.html#gaf76ee4543247e9fb3f3546203e590a6c">apr_status_t</a>) <a class="code" href="group__apr__thread__proc.html#ga88701979c4e5ac4b94966c73e0159efd">apr_proc_other_child_alert</a>(<a class="code" href="structapr__proc__t.html">apr_proc_t</a> *proc, 
<a name="l00744"></a>00744                                                      <span class="keywordtype">int</span> reason,
<a name="l00745"></a>00745                                                      <span class="keywordtype">int</span> status);
<a name="l00746"></a>00746 <span class="comment"></span>
<a name="l00747"></a>00747 <span class="comment">/**</span>
<a name="l00748"></a>00748 <span class="comment"> * Test one specific other child processes and invoke the maintenance callback </span>
<a name="l00749"></a>00749 <span class="comment"> * with the appropriate reason code, if still running, or the appropriate reason </span>
<a name="l00750"></a>00750 <span class="comment"> * code if the process is no longer healthy.</span>
<a name="l00751"></a>00751 <span class="comment"> * @param ocr The registered other child</span>
<a name="l00752"></a>00752 <span class="comment"> * @param reason The reason code (e.g. APR_OC_REASON_RESTART) if still running</span>
<a name="l00753"></a>00753 <span class="comment"> */</span>
<a name="l00754"></a>00754 <a class="code" href="group__apr__platform.html#gad7b91b811a172bfa802603c2fb688f98">APR_DECLARE</a>(<span class="keywordtype">void</span>) <a class="code" href="group__apr__thread__proc.html#ga74a905d90a3476a611adeeb304931a6c">apr_proc_other_child_refresh</a>(<a class="code" href="group__apr__thread__proc.html#gafc52ee8b19a7b222278d31ebb3f11a71">apr_other_child_rec_t</a> *ocr,
<a name="l00755"></a>00755                                                <span class="keywordtype">int</span> reason);
<a name="l00756"></a>00756 <span class="comment"></span>
<a name="l00757"></a>00757 <span class="comment">/**</span>
<a name="l00758"></a>00758 <span class="comment"> * Test all registered other child processes and invoke the maintenance callback </span>
<a name="l00759"></a>00759 <span class="comment"> * with the appropriate reason code, if still running, or the appropriate reason </span>
<a name="l00760"></a>00760 <span class="comment"> * code if the process is no longer healthy.</span>
<a name="l00761"></a>00761 <span class="comment"> * @param reason The reason code (e.g. APR_OC_REASON_RESTART) to running processes</span>
<a name="l00762"></a>00762 <span class="comment"> */</span>
<a name="l00763"></a>00763 <a class="code" href="group__apr__platform.html#gad7b91b811a172bfa802603c2fb688f98">APR_DECLARE</a>(<span class="keywordtype">void</span>) <a class="code" href="group__apr__thread__proc.html#gacff5e867a92619d30c4e78f9ad2a58e3">apr_proc_other_child_refresh_all</a>(<span class="keywordtype">int</span> reason);
<a name="l00764"></a>00764 <span class="comment"></span>
<a name="l00765"></a>00765 <span class="comment">/** </span>
<a name="l00766"></a>00766 <span class="comment"> * Terminate a process.</span>
<a name="l00767"></a>00767 <span class="comment"> * @param proc The process to terminate.</span>
<a name="l00768"></a>00768 <span class="comment"> * @param sig How to kill the process.</span>
<a name="l00769"></a>00769 <span class="comment"> */</span>
<a name="l00770"></a>00770 <a class="code" href="group__apr__platform.html#gad7b91b811a172bfa802603c2fb688f98">APR_DECLARE</a>(<a class="code" href="group__apr__errno.html#gaf76ee4543247e9fb3f3546203e590a6c">apr_status_t</a>) <a class="code" href="group__apr__thread__proc.html#ga4a5ff2fce2c68460281b0cb3ee0365d5">apr_proc_kill</a>(<a class="code" href="structapr__proc__t.html">apr_proc_t</a> *proc, <span class="keywordtype">int</span> sig);
<a name="l00771"></a>00771 <span class="comment"></span>
<a name="l00772"></a>00772 <span class="comment">/**</span>
<a name="l00773"></a>00773 <span class="comment"> * Register a process to be killed when a pool dies.</span>
<a name="l00774"></a>00774 <span class="comment"> * @param a The pool to use to define the processes lifetime </span>
<a name="l00775"></a>00775 <span class="comment"> * @param proc The process to register</span>
<a name="l00776"></a>00776 <span class="comment"> * @param how How to kill the process, one of:</span>
<a name="l00777"></a>00777 <span class="comment"> * &lt;PRE&gt;</span>
<a name="l00778"></a>00778 <span class="comment"> *         APR_KILL_NEVER         -- process is never sent any signals</span>
<a name="l00779"></a>00779 <span class="comment"> *         APR_KILL_ALWAYS        -- process is sent SIGKILL on apr_pool_t cleanup</span>
<a name="l00780"></a>00780 <span class="comment"> *         APR_KILL_AFTER_TIMEOUT -- SIGTERM, wait 3 seconds, SIGKILL</span>
<a name="l00781"></a>00781 <span class="comment"> *         APR_JUST_WAIT          -- wait forever for the process to complete</span>
<a name="l00782"></a>00782 <span class="comment"> *         APR_KILL_ONLY_ONCE     -- send SIGTERM and then wait</span>
<a name="l00783"></a>00783 <span class="comment"> * &lt;/PRE&gt;</span>
<a name="l00784"></a>00784 <span class="comment"> */</span>
<a name="l00785"></a>00785 <a class="code" href="group__apr__platform.html#gad7b91b811a172bfa802603c2fb688f98">APR_DECLARE</a>(<span class="keywordtype">void</span>) <a class="code" href="group__apr__thread__proc.html#gacbe3fd9491fa35149de28cebcae22f87">apr_pool_note_subprocess</a>(<a class="code" href="group__apr__pools.html#gaf137f28edcf9a086cd6bc36c20d7cdfb">apr_pool_t</a> *a, <a class="code" href="structapr__proc__t.html">apr_proc_t</a> *proc,
<a name="l00786"></a>00786                                            <a class="code" href="group__apr__thread__proc.html#ga3eaec78633742e7e0cb9480a21477aff">apr_kill_conditions_e</a> how);
<a name="l00787"></a>00787 
<a name="l00788"></a>00788 <span class="preprocessor">#if APR_HAS_THREADS </span>
<a name="l00789"></a>00789 <span class="preprocessor"></span>
<a name="l00790"></a>00790 <span class="preprocessor">#if (APR_HAVE_SIGWAIT || APR_HAVE_SIGSUSPEND) &amp;&amp; !defined(OS2)</span>
<a name="l00791"></a>00791 <span class="preprocessor"></span><span class="comment"></span>
<a name="l00792"></a>00792 <span class="comment">/**</span>
<a name="l00793"></a>00793 <span class="comment"> * Setup the process for a single thread to be used for all signal handling.</span>
<a name="l00794"></a>00794 <span class="comment"> * @warning This must be called before any threads are created</span>
<a name="l00795"></a>00795 <span class="comment"> */</span>
<a name="l00796"></a>00796 <a class="code" href="group__apr__platform.html#gad7b91b811a172bfa802603c2fb688f98">APR_DECLARE</a>(<a class="code" href="group__apr__errno.html#gaf76ee4543247e9fb3f3546203e590a6c">apr_status_t</a>) <a class="code" href="group__apr__thread__proc.html#ga7adc09cd24568666266edce81cfffbed">apr_setup_signal_thread</a>(<span class="keywordtype">void</span>);
<a name="l00797"></a>00797 <span class="comment"></span>
<a name="l00798"></a>00798 <span class="comment">/**</span>
<a name="l00799"></a>00799 <span class="comment"> * Make the current thread listen for signals.  This thread will loop</span>
<a name="l00800"></a>00800 <span class="comment"> * forever, calling a provided function whenever it receives a signal.  That</span>
<a name="l00801"></a>00801 <span class="comment"> * functions should return 1 if the signal has been handled, 0 otherwise.</span>
<a name="l00802"></a>00802 <span class="comment"> * @param signal_handler The function to call when a signal is received</span>
<a name="l00803"></a>00803 <span class="comment"> * apr_status_t apr_signal_thread((int)(*signal_handler)(int signum))</span>
<a name="l00804"></a>00804 <span class="comment"> */</span>
<a name="l00805"></a>00805 <a class="code" href="group__apr__platform.html#gad7b91b811a172bfa802603c2fb688f98">APR_DECLARE</a>(<a class="code" href="group__apr__errno.html#gaf76ee4543247e9fb3f3546203e590a6c">apr_status_t</a>) <a class="code" href="group__apr__thread__proc.html#ga2e53fa76ff725749c7affe6c81faa9e5">apr_signal_thread</a>(<span class="keywordtype">int</span>(*signal_handler)(<span class="keywordtype">int</span> signum));
<a name="l00806"></a>00806 
<a name="l00807"></a>00807 <span class="preprocessor">#endif </span><span class="comment">/* (APR_HAVE_SIGWAIT || APR_HAVE_SIGSUSPEND) &amp;&amp; !defined(OS2) */</span>
<a name="l00808"></a>00808 <span class="comment"></span>
<a name="l00809"></a>00809 <span class="comment">/**</span>
<a name="l00810"></a>00810 <span class="comment"> * Get the child-pool used by the thread from the thread info.</span>
<a name="l00811"></a>00811 <span class="comment"> * @return apr_pool_t the pool</span>
<a name="l00812"></a>00812 <span class="comment"> */</span>
<a name="l00813"></a>00813 <a class="code" href="group__apr__pools.html#ga89ce1d55c7f0c39ea87c88eabd655394">APR_POOL_DECLARE_ACCESSOR</a>(thread);
<a name="l00814"></a>00814 
<a name="l00815"></a>00815 <span class="preprocessor">#endif </span><span class="comment">/* APR_HAS_THREADS */</span>
<a name="l00816"></a>00816 <span class="comment"></span>
<a name="l00817"></a>00817 <span class="comment">/** @} */</span>
<a name="l00818"></a>00818 
<a name="l00819"></a>00819 <span class="preprocessor">#ifdef __cplusplus</span>
<a name="l00820"></a>00820 <span class="preprocessor"></span>}
<a name="l00821"></a>00821 <span class="preprocessor">#endif</span>
<a name="l00822"></a>00822 <span class="preprocessor"></span>
<a name="l00823"></a>00823 <span class="preprocessor">#endif  </span><span class="comment">/* ! APR_THREAD_PROC_H */</span>
<a name="l00824"></a>00824 
</pre></div></div>
<!--- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
<a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(0)"><span class="SelectionMark">&nbsp;</span>All</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(1)"><span class="SelectionMark">&nbsp;</span>Data Structures</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(2)"><span class="SelectionMark">&nbsp;</span>Files</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(3)"><span class="SelectionMark">&nbsp;</span>Functions</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(4)"><span class="SelectionMark">&nbsp;</span>Variables</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(5)"><span class="SelectionMark">&nbsp;</span>Typedefs</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(6)"><span class="SelectionMark">&nbsp;</span>Enumerations</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(7)"><span class="SelectionMark">&nbsp;</span>Enumerator</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(8)"><span class="SelectionMark">&nbsp;</span>Defines</a></div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<hr class="footer"/><address style="text-align: right;"><small>Generated on Tue Feb 14 10:09:01 2012 for Apache Portable Runtime by&nbsp;
<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.6.3 </small></address>
</body>
</html>