Sophie

Sophie

distrib > Scientific%20Linux > 5x > x86_64 > by-pkgid > 243222a43997d44a8ac787d018c9535c > files > 67

apr-docs-1.2.7-11.el5_6.5.x86_64.rpm

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1">
<title>Apache Portable Runtime: apr_thread_proc.h Source File</title>
<link href="doxygen.css" rel="stylesheet" type="text/css">
<link href="tabs.css" rel="stylesheet" type="text/css">
</head><body>
<!-- Generated by Doxygen 1.4.7 -->
<div class="tabs">
  <ul>
    <li><a href="index.html"><span>Main&nbsp;Page</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 id="current"><a href="files.html"><span>Files</span></a></li>
    <li><a href="pages.html"><span>Related&nbsp;Pages</span></a></li>
    <li><a href="examples.html"><span>Examples</span></a></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">/* Copyright 2000-2005 The Apache Software Foundation or its licensors, as</span>
<a name="l00002"></a>00002 <span class="comment"> * applicable.</span>
<a name="l00003"></a>00003 <span class="comment"> *</span>
<a name="l00004"></a>00004 <span class="comment"> * Licensed under the Apache License, Version 2.0 (the "License");</span>
<a name="l00005"></a>00005 <span class="comment"> * you may not use this file except in compliance with the License.</span>
<a name="l00006"></a>00006 <span class="comment"> * 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 "AS IS" 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 "<a class="code" href="apr_8h.html">apr.h</a>"</span>
<a name="l00026"></a>00026 <span class="preprocessor">#include "<a class="code" href="apr__file__io_8h.html">apr_file_io.h</a>"</span>
<a name="l00027"></a>00027 <span class="preprocessor">#include "<a class="code" href="apr__pools_8h.html">apr_pools.h</a>"</span>
<a name="l00028"></a>00028 <span class="preprocessor">#include "<a class="code" href="apr__errno_8h.html">apr_errno.h</a>"</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">"C"</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#ga356679c9b4f289627ac1647bb32d4bf">00045</a> <span class="keyword">typedef</span> <span class="keyword">enum</span> {
<a name="l00046"></a>00046     <a class="code" href="group__apr__thread__proc.html#gga356679c9b4f289627ac1647bb32d4bf388aab03a3b2eb6f6d04489b81bbc49a">APR_SHELLCMD</a>,           <span class="comment">/**&lt; use the shell to invoke the program */</span>
<a name="l00047"></a>00047     <a class="code" href="group__apr__thread__proc.html#gga356679c9b4f289627ac1647bb32d4bfe46d222b7da762a66d2382a94bc40b93">APR_PROGRAM</a>,            <span class="comment">/**&lt; invoke the program directly, no copied env */</span>
<a name="l00048"></a>00048     <a class="code" href="group__apr__thread__proc.html#gga356679c9b4f289627ac1647bb32d4bfd0a08bc963db30acb2037a5c79cbf66d">APR_PROGRAM_ENV</a>,        <span class="comment">/**&lt; invoke the program, replicating our environment */</span>
<a name="l00049"></a>00049     <a class="code" href="group__apr__thread__proc.html#gga356679c9b4f289627ac1647bb32d4bfc4bb433040244a1314dc66bc6a931f09">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#gga356679c9b4f289627ac1647bb32d4bf479e5dae45a54ea22350ce5d74ef47d5">00050</a>     <a class="code" href="group__apr__thread__proc.html#gga356679c9b4f289627ac1647bb32d4bf479e5dae45a54ea22350ce5d74ef47d5">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#ga356679c9b4f289627ac1647bb32d4bf">apr_cmdtype_e</a>;
<a name="l00054"></a>00054 
<a name="l00055"></a><a class="code" href="group__apr__thread__proc.html#g441d67d811e9a34e8efcf977c40d0c00">00055</a> <span class="keyword">typedef</span> <span class="keyword">enum</span> {
<a name="l00056"></a>00056     <a class="code" href="group__apr__thread__proc.html#gg441d67d811e9a34e8efcf977c40d0c00a3bf787dff9d8de5a1f81b5311b05324">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#gg441d67d811e9a34e8efcf977c40d0c00111f06c1022537fc80b9e5ecea8bf268">00057</a>     <a class="code" href="group__apr__thread__proc.html#gg441d67d811e9a34e8efcf977c40d0c00111f06c1022537fc80b9e5ecea8bf268">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#g441d67d811e9a34e8efcf977c40d0c00">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'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#gf76f239c21f01710fa0d24c467dbee3c">00065</a> <span class="keyword">typedef</span> <span class="keyword">enum</span> {
<a name="l00066"></a>00066     <a class="code" href="group__apr__thread__proc.html#ggf76f239c21f01710fa0d24c467dbee3c39426b99e48fa82981eba3e7c0713841">APR_PROC_EXIT</a> = 1,          <span class="comment">/**&lt; process exited normally */</span>
<a name="l00067"></a>00067     <a class="code" href="group__apr__thread__proc.html#ggf76f239c21f01710fa0d24c467dbee3c8a96b583c39b10c4416e528109449209">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#ggf76f239c21f01710fa0d24c467dbee3ccd96c38ac9fc78903264243af9a350b2">00068</a>     <a class="code" href="group__apr__thread__proc.html#ggf76f239c21f01710fa0d24c467dbee3ccd96c38ac9fc78903264243af9a350b2">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#gf76f239c21f01710fa0d24c467dbee3c">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#g922f9d24c3486a8bb48692547e540a4d">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#gb23e8365093008eb4b4885c4e11a25d3">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#g6e8b297a3fd3feee0e195d19910106f1">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#gccf5256a74c6f3068b2c3b309abb0211">00079</a> <span class="preprocessor">#define APR_NO_PIPE          0</span>
<a name="l00080"></a>00080 <span class="preprocessor"></span><span class="comment"></span>
<a name="l00081"></a>00081 <span class="comment">/** @see apr_procattr_io_set */</span>
<a name="l00082"></a><a class="code" href="group__apr__thread__proc.html#g06da5a2bcd3c708e31755f37c07c27d0">00082</a> <span class="preprocessor">#define APR_FULL_BLOCK       1</span>
<a name="l00083"></a>00083 <span class="preprocessor"></span><span class="comment">/** @see apr_procattr_io_set */</span>
<a name="l00084"></a><a class="code" href="group__apr__thread__proc.html#g73d40536ffba908f15403b4d82cdd2cc">00084</a> <span class="preprocessor">#define APR_FULL_NONBLOCK    2</span>
<a name="l00085"></a>00085 <span class="preprocessor"></span><span class="comment">/** @see apr_procattr_io_set */</span>
<a name="l00086"></a><a class="code" href="group__apr__thread__proc.html#gb1b43e8f75f4d47728077e3e83a32956">00086</a> <span class="preprocessor">#define APR_PARENT_BLOCK     3</span>
<a name="l00087"></a>00087 <span class="preprocessor"></span><span class="comment">/** @see apr_procattr_io_set */</span>
<a name="l00088"></a><a class="code" href="group__apr__thread__proc.html#g94f8645eed99406a54d969345dde21b3">00088</a> <span class="preprocessor">#define APR_CHILD_BLOCK      4</span>
<a name="l00089"></a>00089 <span class="preprocessor"></span><span class="comment"></span>
<a name="l00090"></a>00090 <span class="comment">/** @see apr_procattr_limit_set */</span>
<a name="l00091"></a><a class="code" href="group__apr__thread__proc.html#gb501f2a461ef4c35dafd9ae080825e9b">00091</a> <span class="preprocessor">#define APR_LIMIT_CPU        0</span>
<a name="l00092"></a>00092 <span class="preprocessor"></span><span class="comment">/** @see apr_procattr_limit_set */</span>
<a name="l00093"></a><a class="code" href="group__apr__thread__proc.html#gab12b50da9ba4394a3a84ebdc42c6976">00093</a> <span class="preprocessor">#define APR_LIMIT_MEM        1</span>
<a name="l00094"></a>00094 <span class="preprocessor"></span><span class="comment">/** @see apr_procattr_limit_set */</span>
<a name="l00095"></a><a class="code" href="group__apr__thread__proc.html#g190e1cf82d730ff6ec593ed1192cf960">00095</a> <span class="preprocessor">#define APR_LIMIT_NPROC      2</span>
<a name="l00096"></a>00096 <span class="preprocessor"></span><span class="comment">/** @see apr_procattr_limit_set */</span>
<a name="l00097"></a><a class="code" href="group__apr__thread__proc.html#g439b634dbff629762402346f521c40ee">00097</a> <span class="preprocessor">#define APR_LIMIT_NOFILE     3</span>
<a name="l00098"></a>00098 <span class="preprocessor"></span><span class="comment"></span>
<a name="l00099"></a>00099 <span class="comment">/**</span>
<a name="l00100"></a>00100 <span class="comment"> * @defgroup APR_OC Other Child Flags</span>
<a name="l00101"></a>00101 <span class="comment"> * @{</span>
<a name="l00102"></a>00102 <span class="comment"> */</span>
<a name="l00103"></a><a class="code" href="group___a_p_r___o_c.html#gde3c94e5c37fac2eea78afe26946616e">00103</a> <span class="preprocessor">#define APR_OC_REASON_DEATH         0     </span><span class="comment">/**&lt; child has died, caller must call</span>
<a name="l00104"></a>00104 <span class="comment">                                           * unregister still */</span>
<a name="l00105"></a><a class="code" href="group___a_p_r___o_c.html#ge8c44a23e7dbc9f66ba83c2f9775b6c1">00105</a> <span class="preprocessor">#define APR_OC_REASON_UNWRITABLE    1     </span><span class="comment">/**&lt; write_fd is unwritable */</span>
<a name="l00106"></a><a class="code" href="group___a_p_r___o_c.html#g64721b1a47e4357a1ffc7c433292f802">00106</a> <span class="preprocessor">#define APR_OC_REASON_RESTART       2     </span><span class="comment">/**&lt; a restart is occuring, perform</span>
<a name="l00107"></a>00107 <span class="comment">                                           * any necessary cleanup (including</span>
<a name="l00108"></a>00108 <span class="comment">                                           * sending a special signal to child)</span>
<a name="l00109"></a>00109 <span class="comment">                                           */</span>
<a name="l00110"></a><a class="code" href="group___a_p_r___o_c.html#ga3e2c79f03005b6a9509bda59c915428">00110</a> <span class="preprocessor">#define APR_OC_REASON_UNREGISTER    3     </span><span class="comment">/**&lt; unregister has been called, do</span>
<a name="l00111"></a>00111 <span class="comment">                                           * whatever is necessary (including</span>
<a name="l00112"></a>00112 <span class="comment">                                           * kill the child) */</span>
<a name="l00113"></a><a class="code" href="group___a_p_r___o_c.html#gcdd01e34e493065a3073af09f90047c4">00113</a> <span class="preprocessor">#define APR_OC_REASON_LOST          4     </span><span class="comment">/**&lt; somehow the child exited without</span>
<a name="l00114"></a>00114 <span class="comment">                                           * us knowing ... buggy os? */</span>
<a name="l00115"></a><a class="code" href="group___a_p_r___o_c.html#g5427294f5cf33e2513f05f8ecac50058">00115</a> <span class="preprocessor">#define APR_OC_REASON_RUNNING       5     </span><span class="comment">/**&lt; a health check is occuring, </span>
<a name="l00116"></a>00116 <span class="comment">                                           * for most maintainence functions</span>
<a name="l00117"></a>00117 <span class="comment">                                           * this is a no-op.</span>
<a name="l00118"></a>00118 <span class="comment">                                           */</span>
<a name="l00119"></a>00119 <span class="comment">/** @} */</span>
<a name="l00120"></a>00120 <span class="comment"></span>
<a name="l00121"></a>00121 <span class="comment">/** The APR process type */</span>
<a name="l00122"></a><a class="code" href="structapr__proc__t.html">00122</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="l00123"></a>00123 <span class="comment">    /** The process ID */</span>
<a name="l00124"></a><a class="code" href="structapr__proc__t.html#83ce4271ac1e37e07f57859d54ff1319">00124</a>     pid_t <a class="code" href="structapr__proc__t.html#83ce4271ac1e37e07f57859d54ff1319">pid</a>;<span class="comment"></span>
<a name="l00125"></a>00125 <span class="comment">    /** Parent's side of pipe to child's stdin */</span>
<a name="l00126"></a><a class="code" href="structapr__proc__t.html#818ddcf92dde3fafe7458ef0f5bd4518">00126</a>     <a class="code" href="group__apr__file__io.html#g804ab64a6f58ddcc3da8d9f54b6f51c2">apr_file_t</a> *<a class="code" href="structapr__proc__t.html#818ddcf92dde3fafe7458ef0f5bd4518">in</a>;<span class="comment"></span>
<a name="l00127"></a>00127 <span class="comment">    /** Parent's side of pipe to child's stdout */</span>
<a name="l00128"></a><a class="code" href="structapr__proc__t.html#417f133f058d4c5bcaaa50740d2ce08f">00128</a>     <a class="code" href="group__apr__file__io.html#g804ab64a6f58ddcc3da8d9f54b6f51c2">apr_file_t</a> *<a class="code" href="structapr__proc__t.html#417f133f058d4c5bcaaa50740d2ce08f">out</a>;<span class="comment"></span>
<a name="l00129"></a>00129 <span class="comment">    /** Parent's side of pipe to child's stdouterr */</span>
<a name="l00130"></a><a class="code" href="structapr__proc__t.html#fad843cbbb754676d1f646bfbc7faa47">00130</a>     <a class="code" href="group__apr__file__io.html#g804ab64a6f58ddcc3da8d9f54b6f51c2">apr_file_t</a> *<a class="code" href="structapr__proc__t.html#fad843cbbb754676d1f646bfbc7faa47">err</a>;
<a name="l00131"></a>00131 <span class="preprocessor">#if APR_HAS_PROC_INVOKED || defined(DOXYGEN)</span>
<a name="l00132"></a>00132 <span class="preprocessor"></span><span class="comment">    /** Diagnositics/debugging string of the command invoked for </span>
<a name="l00133"></a>00133 <span class="comment">     *  this process [only present if APR_HAS_PROC_INVOKED is true]</span>
<a name="l00134"></a>00134 <span class="comment">     * @remark Only enabled on Win32 by default.</span>
<a name="l00135"></a>00135 <span class="comment">     * @bug This should either always or never be present in release</span>
<a name="l00136"></a>00136 <span class="comment">     * builds - since it breaks binary compatibility.  We may enable</span>
<a name="l00137"></a>00137 <span class="comment">     * it always in APR 1.0 yet leave it undefined in most cases.</span>
<a name="l00138"></a>00138 <span class="comment">     */</span>
<a name="l00139"></a><a class="code" href="structapr__proc__t.html#63032bb2ae14d68c0d33e0d5b107684f">00139</a>     <span class="keywordtype">char</span> *<a class="code" href="structapr__proc__t.html#63032bb2ae14d68c0d33e0d5b107684f">invoked</a>;
<a name="l00140"></a>00140 <span class="preprocessor">#endif</span>
<a name="l00141"></a>00141 <span class="preprocessor"></span><span class="preprocessor">#if defined(WIN32) || defined(DOXYGEN)</span>
<a name="l00142"></a>00142 <span class="preprocessor"></span><span class="comment">    /** (Win32 only) Creator's handle granting access to the process</span>
<a name="l00143"></a>00143 <span class="comment">     * @remark This handle is closed and reset to NULL in every case</span>
<a name="l00144"></a>00144 <span class="comment">     * corresponding to a waitpid() on Unix which returns the exit status.</span>
<a name="l00145"></a>00145 <span class="comment">     * Therefore Win32 correspond's to Unix's zombie reaping characteristics</span>
<a name="l00146"></a>00146 <span class="comment">     * and avoids potential handle leaks.</span>
<a name="l00147"></a>00147 <span class="comment">     */</span>
<a name="l00148"></a><a class="code" href="structapr__proc__t.html#1af95359047a4d2d0f8f8206d6673eed">00148</a>     HANDLE <a class="code" href="structapr__proc__t.html#1af95359047a4d2d0f8f8206d6673eed">hproc</a>;
<a name="l00149"></a>00149 <span class="preprocessor">#endif</span>
<a name="l00150"></a>00150 <span class="preprocessor"></span>} <a class="code" href="structapr__proc__t.html">apr_proc_t</a>;
<a name="l00151"></a>00151 <span class="comment"></span>
<a name="l00152"></a>00152 <span class="comment">/**</span>
<a name="l00153"></a>00153 <span class="comment"> * The prototype for APR child errfn functions.  (See the description</span>
<a name="l00154"></a>00154 <span class="comment"> * of apr_procattr_child_errfn_set() for more information.)</span>
<a name="l00155"></a>00155 <span class="comment"> * It is passed the following parameters:</span>
<a name="l00156"></a>00156 <span class="comment"> * @param pool Pool associated with the apr_proc_t.  If your child</span>
<a name="l00157"></a>00157 <span class="comment"> *             error function needs user data, associate it with this</span>
<a name="l00158"></a>00158 <span class="comment"> *             pool.</span>
<a name="l00159"></a>00159 <span class="comment"> * @param err APR error code describing the error</span>
<a name="l00160"></a>00160 <span class="comment"> * @param description Text description of type of processing which failed</span>
<a name="l00161"></a>00161 <span class="comment"> */</span>
<a name="l00162"></a><a class="code" href="group__apr__thread__proc.html#gcccc80278bd5ac4f635f20a58498ed37">00162</a> <span class="keyword">typedef</span> void (<a class="code" href="group__apr__thread__proc.html#gcccc80278bd5ac4f635f20a58498ed37">apr_child_errfn_t</a>)(<a class="code" href="group__apr__pools.html#g06f17a7732f2d04d8ce7010fbb057a8b">apr_pool_t</a> *proc, <a class="code" href="group__apr__errno.html#g4cf2ddae3efce70c508ac7fefc1c47f7">apr_status_t</a> err,
<a name="l00163"></a>00163                                  <span class="keyword">const</span> <span class="keywordtype">char</span> *description);
<a name="l00164"></a>00164 <span class="comment"></span>
<a name="l00165"></a>00165 <span class="comment">/** Opaque Thread structure. */</span>
<a name="l00166"></a><a class="code" href="group__apr__thread__proc.html#gddee38a6ad1965ba15d2f1a34dfe0d25">00166</a> <span class="keyword">typedef</span> <span class="keyword">struct </span><a class="code" href="group__apr__thread__proc.html#gddee38a6ad1965ba15d2f1a34dfe0d25">apr_thread_t</a>           apr_thread_t;
<a name="l00167"></a>00167 <span class="comment"></span>
<a name="l00168"></a>00168 <span class="comment">/** Opaque Thread attributes structure. */</span>
<a name="l00169"></a><a class="code" href="group__apr__thread__proc.html#g8f3fcaad925fd77f87b9b82b48bde4a3">00169</a> <span class="keyword">typedef</span> <span class="keyword">struct </span><a class="code" href="group__apr__thread__proc.html#g8f3fcaad925fd77f87b9b82b48bde4a3">apr_threadattr_t</a>       apr_threadattr_t;
<a name="l00170"></a>00170 <span class="comment"></span>
<a name="l00171"></a>00171 <span class="comment">/** Opaque Process attributes structure. */</span>
<a name="l00172"></a><a class="code" href="group__apr__thread__proc.html#g4809be70b428274c4e4f5fcdf16762e7">00172</a> <span class="keyword">typedef</span> <span class="keyword">struct </span><a class="code" href="group__apr__thread__proc.html#g4809be70b428274c4e4f5fcdf16762e7">apr_procattr_t</a>         apr_procattr_t;
<a name="l00173"></a>00173 <span class="comment"></span>
<a name="l00174"></a>00174 <span class="comment">/** Opaque control variable for one-time atomic variables.  */</span>
<a name="l00175"></a><a class="code" href="group__apr__thread__proc.html#g913450ecf531aa4367a5e42b85d07d27">00175</a> <span class="keyword">typedef</span> <span class="keyword">struct </span><a class="code" href="group__apr__thread__proc.html#g913450ecf531aa4367a5e42b85d07d27">apr_thread_once_t</a>      apr_thread_once_t;
<a name="l00176"></a>00176 <span class="comment"></span>
<a name="l00177"></a>00177 <span class="comment">/** Opaque thread private address space. */</span>
<a name="l00178"></a><a class="code" href="group__apr__thread__proc.html#gc335c4ab7e18beab948b5147828b122f">00178</a> <span class="keyword">typedef</span> <span class="keyword">struct </span><a class="code" href="group__apr__thread__proc.html#gc335c4ab7e18beab948b5147828b122f">apr_threadkey_t</a>        apr_threadkey_t;
<a name="l00179"></a>00179 <span class="comment"></span>
<a name="l00180"></a>00180 <span class="comment">/** Opaque record of child process. */</span>
<a name="l00181"></a><a class="code" href="group__apr__thread__proc.html#ga90d3921391bc9b4977ab06294aa2c35">00181</a> <span class="keyword">typedef</span> <span class="keyword">struct </span><a class="code" href="group__apr__thread__proc.html#ga90d3921391bc9b4977ab06294aa2c35">apr_other_child_rec_t</a>  apr_other_child_rec_t;
<a name="l00182"></a>00182 <span class="comment"></span>
<a name="l00183"></a>00183 <span class="comment">/**</span>
<a name="l00184"></a>00184 <span class="comment"> * The prototype for any APR thread worker functions.</span>
<a name="l00185"></a>00185 <span class="comment"> */</span>
<a name="l00186"></a><a class="code" href="group__apr__thread__proc.html#g0354a4c4da143b0d4bf8577b4b3a6339">00186</a> <span class="keyword">typedef</span> <span class="keywordtype">void</span> *(<a class="code" href="group__apr__platform.html#g6cad74f17d29cc62edf9c98fe6db4197">APR_THREAD_FUNC</a> *<a class="code" href="group__apr__thread__proc.html#g0354a4c4da143b0d4bf8577b4b3a6339">apr_thread_start_t</a>)(apr_thread_t*, <span class="keywordtype">void</span>*);
<a name="l00187"></a>00187 
<a name="l00188"></a><a class="code" href="group__apr__thread__proc.html#gd06e4d10da2b8be07de6359ecb9bb967">00188</a> <span class="keyword">typedef</span> <span class="keyword">enum</span> {
<a name="l00189"></a>00189     <a class="code" href="group__apr__thread__proc.html#ggd06e4d10da2b8be07de6359ecb9bb9675f3a021eee38e83309a9defeee6357c6">APR_KILL_NEVER</a>,             <span class="comment">/**&lt; process is never sent any signals */</span>
<a name="l00190"></a>00190     <a class="code" href="group__apr__thread__proc.html#ggd06e4d10da2b8be07de6359ecb9bb967d0d7c8773dd82eedc1581ca759d7b320">APR_KILL_ALWAYS</a>,            <span class="comment">/**&lt; process is sent SIGKILL on apr_pool_t cleanup */</span>
<a name="l00191"></a>00191     <a class="code" href="group__apr__thread__proc.html#ggd06e4d10da2b8be07de6359ecb9bb9677ba5784bd252d6c2ac34c6fbc056df73">APR_KILL_AFTER_TIMEOUT</a>,     <span class="comment">/**&lt; SIGTERM, wait 3 seconds, SIGKILL */</span>
<a name="l00192"></a>00192     <a class="code" href="group__apr__thread__proc.html#ggd06e4d10da2b8be07de6359ecb9bb9676c7e0dfb1a6f7290380a7e890aedc681">APR_JUST_WAIT</a>,              <span class="comment">/**&lt; wait forever for the process to complete */</span>
<a name="l00193"></a><a class="code" href="group__apr__thread__proc.html#ggd06e4d10da2b8be07de6359ecb9bb967d6804ace10cc48b392e2bb5c1f6f83f6">00193</a>     <a class="code" href="group__apr__thread__proc.html#ggd06e4d10da2b8be07de6359ecb9bb967d6804ace10cc48b392e2bb5c1f6f83f6">APR_KILL_ONLY_ONCE</a>          <span class="comment">/**&lt; send SIGTERM and then wait */</span>
<a name="l00194"></a>00194 } <a class="code" href="group__apr__thread__proc.html#gd06e4d10da2b8be07de6359ecb9bb967">apr_kill_conditions_e</a>;
<a name="l00195"></a>00195 
<a name="l00196"></a>00196 <span class="comment">/* Thread Function definitions */</span>
<a name="l00197"></a>00197 
<a name="l00198"></a>00198 <span class="preprocessor">#if APR_HAS_THREADS</span>
<a name="l00199"></a>00199 <span class="preprocessor"></span><span class="comment"></span>
<a name="l00200"></a>00200 <span class="comment">/**</span>
<a name="l00201"></a>00201 <span class="comment"> * Create and initialize a new threadattr variable</span>
<a name="l00202"></a>00202 <span class="comment"> * @param new_attr The newly created threadattr.</span>
<a name="l00203"></a>00203 <span class="comment"> * @param cont The pool to use</span>
<a name="l00204"></a>00204 <span class="comment"> */</span>
<a name="l00205"></a>00205 <a class="code" href="group__apr__platform.html#g4a5cbc739c4e19ab450020163d0899d4">APR_DECLARE</a>(<a class="code" href="group__apr__errno.html#g4cf2ddae3efce70c508ac7fefc1c47f7">apr_status_t</a>) <a class="code" href="group__apr__thread__proc.html#g032564285ec1cc95e4768d54b6aa3d9c">apr_threadattr_create</a>(apr_threadattr_t **new_attr, 
<a name="l00206"></a>00206                                                 <a class="code" href="group__apr__pools.html#g06f17a7732f2d04d8ce7010fbb057a8b">apr_pool_t</a> *cont);
<a name="l00207"></a>00207 <span class="comment"></span>
<a name="l00208"></a>00208 <span class="comment">/**</span>
<a name="l00209"></a>00209 <span class="comment"> * Set if newly created threads should be created in detached state.</span>
<a name="l00210"></a>00210 <span class="comment"> * @param attr The threadattr to affect </span>
<a name="l00211"></a>00211 <span class="comment"> * @param on Non-zero if detached threads should be created.</span>
<a name="l00212"></a>00212 <span class="comment"> */</span>
<a name="l00213"></a>00213 <a class="code" href="group__apr__platform.html#g4a5cbc739c4e19ab450020163d0899d4">APR_DECLARE</a>(<a class="code" href="group__apr__errno.html#g4cf2ddae3efce70c508ac7fefc1c47f7">apr_status_t</a>) <a class="code" href="group__apr__thread__proc.html#g133dbbce0473b010d2c988d0b26a225b">apr_threadattr_detach_set</a>(apr_threadattr_t *attr, 
<a name="l00214"></a>00214                                                     apr_int32_t on);
<a name="l00215"></a>00215 <span class="comment"></span>
<a name="l00216"></a>00216 <span class="comment">/**</span>
<a name="l00217"></a>00217 <span class="comment"> * Get the detach state for this threadattr.</span>
<a name="l00218"></a>00218 <span class="comment"> * @param attr The threadattr to reference</span>
<a name="l00219"></a>00219 <span class="comment"> * @return APR_DETACH if threads are to be detached, or APR_NOTDETACH</span>
<a name="l00220"></a>00220 <span class="comment"> * if threads are to be joinable. </span>
<a name="l00221"></a>00221 <span class="comment"> */</span>
<a name="l00222"></a>00222 <a class="code" href="group__apr__platform.html#g4a5cbc739c4e19ab450020163d0899d4">APR_DECLARE</a>(<a class="code" href="group__apr__errno.html#g4cf2ddae3efce70c508ac7fefc1c47f7">apr_status_t</a>) <a class="code" href="group__apr__thread__proc.html#gf895ddcfc4bb23207a0a17135c9baa24">apr_threadattr_detach_get</a>(apr_threadattr_t *attr);
<a name="l00223"></a>00223 <span class="comment"></span>
<a name="l00224"></a>00224 <span class="comment">/**</span>
<a name="l00225"></a>00225 <span class="comment"> * Set the stack size of newly created threads.</span>
<a name="l00226"></a>00226 <span class="comment"> * @param attr The threadattr to affect </span>
<a name="l00227"></a>00227 <span class="comment"> * @param stacksize The stack size in bytes</span>
<a name="l00228"></a>00228 <span class="comment"> */</span>
<a name="l00229"></a>00229 <a class="code" href="group__apr__platform.html#g4a5cbc739c4e19ab450020163d0899d4">APR_DECLARE</a>(<a class="code" href="group__apr__errno.html#g4cf2ddae3efce70c508ac7fefc1c47f7">apr_status_t</a>) <a class="code" href="group__apr__thread__proc.html#g2828b30f695bde84ac7a96fb31525636">apr_threadattr_stacksize_set</a>(apr_threadattr_t *attr,
<a name="l00230"></a>00230                                                        apr_size_t stacksize);
<a name="l00231"></a>00231 <span class="comment"></span>
<a name="l00232"></a>00232 <span class="comment">/**</span>
<a name="l00233"></a>00233 <span class="comment"> * Set the stack guard area size of newly created threads.</span>
<a name="l00234"></a>00234 <span class="comment"> * @param attr The threadattr to affect </span>
<a name="l00235"></a>00235 <span class="comment"> * @param guardsize The stack guard area size in bytes</span>
<a name="l00236"></a>00236 <span class="comment"> * @note Thread library implementations commonly use a "guard area"</span>
<a name="l00237"></a>00237 <span class="comment"> * after each thread's stack which is not readable or writable such that</span>
<a name="l00238"></a>00238 <span class="comment"> * stack overflows cause a segfault; this consumes e.g. 4K of memory</span>
<a name="l00239"></a>00239 <span class="comment"> * and increases memory management overhead.  Setting the guard area</span>
<a name="l00240"></a>00240 <span class="comment"> * size to zero hence trades off reliable behaviour on stack overflow</span>
<a name="l00241"></a>00241 <span class="comment"> * for performance. */</span>
<a name="l00242"></a>00242 <a class="code" href="group__apr__platform.html#g4a5cbc739c4e19ab450020163d0899d4">APR_DECLARE</a>(<a class="code" href="group__apr__errno.html#g4cf2ddae3efce70c508ac7fefc1c47f7">apr_status_t</a>) <a class="code" href="group__apr__thread__proc.html#gcc0316f693a6f526b977cd81d7a0708d">apr_threadattr_guardsize_set</a>(apr_threadattr_t *attr,
<a name="l00243"></a>00243                                                        apr_size_t guardsize);
<a name="l00244"></a>00244 <span class="comment"></span>
<a name="l00245"></a>00245 <span class="comment">/**</span>
<a name="l00246"></a>00246 <span class="comment"> * Create a new thread of execution</span>
<a name="l00247"></a>00247 <span class="comment"> * @param new_thread The newly created thread handle.</span>
<a name="l00248"></a>00248 <span class="comment"> * @param attr The threadattr to use to determine how to create the thread</span>
<a name="l00249"></a>00249 <span class="comment"> * @param func The function to start the new thread in</span>
<a name="l00250"></a>00250 <span class="comment"> * @param data Any data to be passed to the starting function</span>
<a name="l00251"></a>00251 <span class="comment"> * @param cont The pool to use</span>
<a name="l00252"></a>00252 <span class="comment"> */</span>
<a name="l00253"></a>00253 <a class="code" href="group__apr__platform.html#g4a5cbc739c4e19ab450020163d0899d4">APR_DECLARE</a>(<a class="code" href="group__apr__errno.html#g4cf2ddae3efce70c508ac7fefc1c47f7">apr_status_t</a>) <a class="code" href="group__apr__thread__proc.html#g4140da68445644e59723d54cc96cc675">apr_thread_create</a>(apr_thread_t **new_thread, 
<a name="l00254"></a>00254                                             apr_threadattr_t *attr, 
<a name="l00255"></a>00255                                             <a class="code" href="group__apr__thread__proc.html#g0354a4c4da143b0d4bf8577b4b3a6339">apr_thread_start_t</a> func, 
<a name="l00256"></a>00256                                             <span class="keywordtype">void</span> *data, <a class="code" href="group__apr__pools.html#g06f17a7732f2d04d8ce7010fbb057a8b">apr_pool_t</a> *cont);
<a name="l00257"></a>00257 <span class="comment"></span>
<a name="l00258"></a>00258 <span class="comment">/**</span>
<a name="l00259"></a>00259 <span class="comment"> * stop the current thread</span>
<a name="l00260"></a>00260 <span class="comment"> * @param thd The thread to stop</span>
<a name="l00261"></a>00261 <span class="comment"> * @param retval The return value to pass back to any thread that cares</span>
<a name="l00262"></a>00262 <span class="comment"> */</span>
<a name="l00263"></a>00263 <a class="code" href="group__apr__platform.html#g4a5cbc739c4e19ab450020163d0899d4">APR_DECLARE</a>(<a class="code" href="group__apr__errno.html#g4cf2ddae3efce70c508ac7fefc1c47f7">apr_status_t</a>) <a class="code" href="group__apr__thread__proc.html#g99a204357ad4850a3778c4eb98d05dc3">apr_thread_exit</a>(apr_thread_t *thd, 
<a name="l00264"></a>00264                                           <a class="code" href="group__apr__errno.html#g4cf2ddae3efce70c508ac7fefc1c47f7">apr_status_t</a> retval);
<a name="l00265"></a>00265 <span class="comment"></span>
<a name="l00266"></a>00266 <span class="comment">/**</span>
<a name="l00267"></a>00267 <span class="comment"> * block until the desired thread stops executing.</span>
<a name="l00268"></a>00268 <span class="comment"> * @param retval The return value from the dead thread.</span>
<a name="l00269"></a>00269 <span class="comment"> * @param thd The thread to join</span>
<a name="l00270"></a>00270 <span class="comment"> */</span>
<a name="l00271"></a>00271 <a class="code" href="group__apr__platform.html#g4a5cbc739c4e19ab450020163d0899d4">APR_DECLARE</a>(<a class="code" href="group__apr__errno.html#g4cf2ddae3efce70c508ac7fefc1c47f7">apr_status_t</a>) <a class="code" href="group__apr__thread__proc.html#g146f8d1eca571e0955caa737bb5c3a83">apr_thread_join</a>(<a class="code" href="group__apr__errno.html#g4cf2ddae3efce70c508ac7fefc1c47f7">apr_status_t</a> *retval, 
<a name="l00272"></a>00272                                           apr_thread_t *thd); 
<a name="l00273"></a>00273 <span class="comment"></span>
<a name="l00274"></a>00274 <span class="comment">/**</span>
<a name="l00275"></a>00275 <span class="comment"> * force the current thread to yield the processor</span>
<a name="l00276"></a>00276 <span class="comment"> */</span>
<a name="l00277"></a>00277 <a class="code" href="group__apr__platform.html#g4a5cbc739c4e19ab450020163d0899d4">APR_DECLARE</a>(<span class="keywordtype">void</span>) <a class="code" href="group__apr__thread__proc.html#g4b4df1e8b2064db59db43ce8017eca81">apr_thread_yield</a>(<span class="keywordtype">void</span>);
<a name="l00278"></a>00278 <span class="comment"></span>
<a name="l00279"></a>00279 <span class="comment">/**</span>
<a name="l00280"></a>00280 <span class="comment"> * Initialize the control variable for apr_thread_once.  If this isn't</span>
<a name="l00281"></a>00281 <span class="comment"> * called, apr_initialize won't work.</span>
<a name="l00282"></a>00282 <span class="comment"> * @param control The control variable to initialize</span>
<a name="l00283"></a>00283 <span class="comment"> * @param p The pool to allocate data from.</span>
<a name="l00284"></a>00284 <span class="comment"> */</span>
<a name="l00285"></a>00285 <a class="code" href="group__apr__platform.html#g4a5cbc739c4e19ab450020163d0899d4">APR_DECLARE</a>(<a class="code" href="group__apr__errno.html#g4cf2ddae3efce70c508ac7fefc1c47f7">apr_status_t</a>) <a class="code" href="group__apr__thread__proc.html#ge90f810018fd65a31511a22673fdeb82">apr_thread_once_init</a>(apr_thread_once_t **control,
<a name="l00286"></a>00286                                                <a class="code" href="group__apr__pools.html#g06f17a7732f2d04d8ce7010fbb057a8b">apr_pool_t</a> *p);
<a name="l00287"></a>00287 <span class="comment"></span>
<a name="l00288"></a>00288 <span class="comment">/**</span>
<a name="l00289"></a>00289 <span class="comment"> * Run the specified function one time, regardless of how many threads</span>
<a name="l00290"></a>00290 <span class="comment"> * call it.</span>
<a name="l00291"></a>00291 <span class="comment"> * @param control The control variable.  The same variable should</span>
<a name="l00292"></a>00292 <span class="comment"> *                be passed in each time the function is tried to be</span>
<a name="l00293"></a>00293 <span class="comment"> *                called.  This is how the underlying functions determine</span>
<a name="l00294"></a>00294 <span class="comment"> *                if the function has ever been called before.</span>
<a name="l00295"></a>00295 <span class="comment"> * @param func The function to call.</span>
<a name="l00296"></a>00296 <span class="comment"> */</span>
<a name="l00297"></a>00297 <a class="code" href="group__apr__platform.html#g4a5cbc739c4e19ab450020163d0899d4">APR_DECLARE</a>(<a class="code" href="group__apr__errno.html#g4cf2ddae3efce70c508ac7fefc1c47f7">apr_status_t</a>) <a class="code" href="group__apr__thread__proc.html#g8761d0245552b7b7b566096473428f88">apr_thread_once</a>(apr_thread_once_t *control,
<a name="l00298"></a>00298                                           <span class="keywordtype">void</span> (*func)(<span class="keywordtype">void</span>));
<a name="l00299"></a>00299 <span class="comment"></span>
<a name="l00300"></a>00300 <span class="comment">/**</span>
<a name="l00301"></a>00301 <span class="comment"> * detach a thread</span>
<a name="l00302"></a>00302 <span class="comment"> * @param thd The thread to detach </span>
<a name="l00303"></a>00303 <span class="comment"> */</span>
<a name="l00304"></a>00304 <a class="code" href="group__apr__platform.html#g4a5cbc739c4e19ab450020163d0899d4">APR_DECLARE</a>(<a class="code" href="group__apr__errno.html#g4cf2ddae3efce70c508ac7fefc1c47f7">apr_status_t</a>) <a class="code" href="group__apr__thread__proc.html#ge705661d3d05a75097b3d2a37df33d64">apr_thread_detach</a>(apr_thread_t *thd);
<a name="l00305"></a>00305 <span class="comment"></span>
<a name="l00306"></a>00306 <span class="comment">/**</span>
<a name="l00307"></a>00307 <span class="comment"> * Return the pool associated with the current thread.</span>
<a name="l00308"></a>00308 <span class="comment"> * @param data The user data associated with the thread.</span>
<a name="l00309"></a>00309 <span class="comment"> * @param key The key to associate with the data</span>
<a name="l00310"></a>00310 <span class="comment"> * @param thread The currently open thread.</span>
<a name="l00311"></a>00311 <span class="comment"> */</span>
<a name="l00312"></a>00312 <a class="code" href="group__apr__platform.html#g4a5cbc739c4e19ab450020163d0899d4">APR_DECLARE</a>(<a class="code" href="group__apr__errno.html#g4cf2ddae3efce70c508ac7fefc1c47f7">apr_status_t</a>) <a class="code" href="group__apr__thread__proc.html#gf944a98f0bb5b36dc7fcab60b2dc2e19">apr_thread_data_get</a>(<span class="keywordtype">void</span> **data, const <span class="keywordtype">char</span> *key,
<a name="l00313"></a>00313                                              apr_thread_t *thread);
<a name="l00314"></a>00314 <span class="comment"></span>
<a name="l00315"></a>00315 <span class="comment">/**</span>
<a name="l00316"></a>00316 <span class="comment"> * Return the pool associated with the current thread.</span>
<a name="l00317"></a>00317 <span class="comment"> * @param data The user data to associate with the thread.</span>
<a name="l00318"></a>00318 <span class="comment"> * @param key The key to use for associating the data with the thread</span>
<a name="l00319"></a>00319 <span class="comment"> * @param cleanup The cleanup routine to use when the thread is destroyed.</span>
<a name="l00320"></a>00320 <span class="comment"> * @param thread The currently open thread.</span>
<a name="l00321"></a>00321 <span class="comment"> */</span>
<a name="l00322"></a>00322 <a class="code" href="group__apr__platform.html#g4a5cbc739c4e19ab450020163d0899d4">APR_DECLARE</a>(<a class="code" href="group__apr__errno.html#g4cf2ddae3efce70c508ac7fefc1c47f7">apr_status_t</a>) <a class="code" href="group__apr__thread__proc.html#gd85151b1faf08ad7f070c464a776ce3a">apr_thread_data_set</a>(<span class="keywordtype">void</span> *data, const <span class="keywordtype">char</span> *key,
<a name="l00323"></a>00323                                              <a class="code" href="group__apr__errno.html#g4cf2ddae3efce70c508ac7fefc1c47f7">apr_status_t</a> (*cleanup) (<span class="keywordtype">void</span> *),
<a name="l00324"></a>00324                                              apr_thread_t *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"> * Create and initialize a new thread private address space</span>
<a name="l00328"></a>00328 <span class="comment"> * @param key The thread private handle.</span>
<a name="l00329"></a>00329 <span class="comment"> * @param dest The destructor to use when freeing the private memory.</span>
<a name="l00330"></a>00330 <span class="comment"> * @param cont The pool to use</span>
<a name="l00331"></a>00331 <span class="comment"> */</span>
<a name="l00332"></a>00332 <a class="code" href="group__apr__platform.html#g4a5cbc739c4e19ab450020163d0899d4">APR_DECLARE</a>(<a class="code" href="group__apr__errno.html#g4cf2ddae3efce70c508ac7fefc1c47f7">apr_status_t</a>) <a class="code" href="group__apr__thread__proc.html#ge7df2a34a3141c3aba306d13dbb55501">apr_threadkey_private_create</a>(apr_threadkey_t **key, 
<a name="l00333"></a>00333                                                     <span class="keywordtype">void</span> (*dest)(<span class="keywordtype">void</span> *),
<a name="l00334"></a>00334                                                     <a class="code" href="group__apr__pools.html#g06f17a7732f2d04d8ce7010fbb057a8b">apr_pool_t</a> *cont);
<a name="l00335"></a>00335 <span class="comment"></span>
<a name="l00336"></a>00336 <span class="comment">/**</span>
<a name="l00337"></a>00337 <span class="comment"> * Get a pointer to the thread private memory</span>
<a name="l00338"></a>00338 <span class="comment"> * @param new_mem The data stored in private memory </span>
<a name="l00339"></a>00339 <span class="comment"> * @param key The handle for the desired thread private memory </span>
<a name="l00340"></a>00340 <span class="comment"> */</span>
<a name="l00341"></a>00341 <a class="code" href="group__apr__platform.html#g4a5cbc739c4e19ab450020163d0899d4">APR_DECLARE</a>(<a class="code" href="group__apr__errno.html#g4cf2ddae3efce70c508ac7fefc1c47f7">apr_status_t</a>) <a class="code" href="group__apr__thread__proc.html#g20fb246e7b90930f4db9ccc5d7cb91de">apr_threadkey_private_get</a>(<span class="keywordtype">void</span> **new_mem, 
<a name="l00342"></a>00342                                                  apr_threadkey_t *key);
<a name="l00343"></a>00343 <span class="comment"></span>
<a name="l00344"></a>00344 <span class="comment">/**</span>
<a name="l00345"></a>00345 <span class="comment"> * Set the data to be stored in thread private memory</span>
<a name="l00346"></a>00346 <span class="comment"> * @param priv The data to be stored in private memory </span>
<a name="l00347"></a>00347 <span class="comment"> * @param key The handle for the desired thread private memory </span>
<a name="l00348"></a>00348 <span class="comment"> */</span>
<a name="l00349"></a>00349 <a class="code" href="group__apr__platform.html#g4a5cbc739c4e19ab450020163d0899d4">APR_DECLARE</a>(<a class="code" href="group__apr__errno.html#g4cf2ddae3efce70c508ac7fefc1c47f7">apr_status_t</a>) <a class="code" href="group__apr__thread__proc.html#ge675cd55be2abca1acbdd8083921a9f4">apr_threadkey_private_set</a>(<span class="keywordtype">void</span> *priv, 
<a name="l00350"></a>00350                                                  apr_threadkey_t *key);
<a name="l00351"></a>00351 <span class="comment"></span>
<a name="l00352"></a>00352 <span class="comment">/**</span>
<a name="l00353"></a>00353 <span class="comment"> * Free the thread private memory</span>
<a name="l00354"></a>00354 <span class="comment"> * @param key The handle for the desired thread private memory </span>
<a name="l00355"></a>00355 <span class="comment"> */</span>
<a name="l00356"></a>00356 <a class="code" href="group__apr__platform.html#g4a5cbc739c4e19ab450020163d0899d4">APR_DECLARE</a>(<a class="code" href="group__apr__errno.html#g4cf2ddae3efce70c508ac7fefc1c47f7">apr_status_t</a>) <a class="code" href="group__apr__thread__proc.html#g2bcf901c987c6e257790fffd5ccf9582">apr_threadkey_private_delete</a>(apr_threadkey_t *key);
<a name="l00357"></a>00357 <span class="comment"></span>
<a name="l00358"></a>00358 <span class="comment">/**</span>
<a name="l00359"></a>00359 <span class="comment"> * Return the pool associated with the current threadkey.</span>
<a name="l00360"></a>00360 <span class="comment"> * @param data The user data associated with the threadkey.</span>
<a name="l00361"></a>00361 <span class="comment"> * @param key The key associated with the data</span>
<a name="l00362"></a>00362 <span class="comment"> * @param threadkey The currently open threadkey.</span>
<a name="l00363"></a>00363 <span class="comment"> */</span>
<a name="l00364"></a>00364 <a class="code" href="group__apr__platform.html#g4a5cbc739c4e19ab450020163d0899d4">APR_DECLARE</a>(<a class="code" href="group__apr__errno.html#g4cf2ddae3efce70c508ac7fefc1c47f7">apr_status_t</a>) <a class="code" href="group__apr__thread__proc.html#gfb53d94073c9906f1199a228eed366dc">apr_threadkey_data_get</a>(<span class="keywordtype">void</span> **data, const <span class="keywordtype">char</span> *key,
<a name="l00365"></a>00365                                                 apr_threadkey_t *threadkey);
<a name="l00366"></a>00366 <span class="comment"></span>
<a name="l00367"></a>00367 <span class="comment">/**</span>
<a name="l00368"></a>00368 <span class="comment"> * Return the pool associated with the current threadkey.</span>
<a name="l00369"></a>00369 <span class="comment"> * @param data The data to set.</span>
<a name="l00370"></a>00370 <span class="comment"> * @param key The key to associate with the data.</span>
<a name="l00371"></a>00371 <span class="comment"> * @param cleanup The cleanup routine to use when the file is destroyed.</span>
<a name="l00372"></a>00372 <span class="comment"> * @param threadkey The currently open threadkey.</span>
<a name="l00373"></a>00373 <span class="comment"> */</span>
<a name="l00374"></a>00374 <a class="code" href="group__apr__platform.html#g4a5cbc739c4e19ab450020163d0899d4">APR_DECLARE</a>(<a class="code" href="group__apr__errno.html#g4cf2ddae3efce70c508ac7fefc1c47f7">apr_status_t</a>) <a class="code" href="group__apr__thread__proc.html#ge9eb079d982cc26f3065f0514424c46f">apr_threadkey_data_set</a>(<span class="keywordtype">void</span> *data, const <span class="keywordtype">char</span> *key,
<a name="l00375"></a>00375                                                 <a class="code" href="group__apr__errno.html#g4cf2ddae3efce70c508ac7fefc1c47f7">apr_status_t</a> (*cleanup) (<span class="keywordtype">void</span> *),
<a name="l00376"></a>00376                                                 apr_threadkey_t *threadkey);
<a name="l00377"></a>00377 
<a name="l00378"></a>00378 <span class="preprocessor">#endif</span>
<a name="l00379"></a>00379 <span class="preprocessor"></span><span class="comment"></span>
<a name="l00380"></a>00380 <span class="comment">/**</span>
<a name="l00381"></a>00381 <span class="comment"> * Create and initialize a new procattr variable</span>
<a name="l00382"></a>00382 <span class="comment"> * @param new_attr The newly created procattr. </span>
<a name="l00383"></a>00383 <span class="comment"> * @param cont The pool to use</span>
<a name="l00384"></a>00384 <span class="comment"> */</span>
<a name="l00385"></a>00385 <a class="code" href="group__apr__platform.html#g4a5cbc739c4e19ab450020163d0899d4">APR_DECLARE</a>(<a class="code" href="group__apr__errno.html#g4cf2ddae3efce70c508ac7fefc1c47f7">apr_status_t</a>) <a class="code" href="group__apr__thread__proc.html#g556f95e042942115ba4a7c3ef84f5a42">apr_procattr_create</a>(apr_procattr_t **new_attr,
<a name="l00386"></a>00386                                                   <a class="code" href="group__apr__pools.html#g06f17a7732f2d04d8ce7010fbb057a8b">apr_pool_t</a> *cont);
<a name="l00387"></a>00387 <span class="comment"></span>
<a name="l00388"></a>00388 <span class="comment">/**</span>
<a name="l00389"></a>00389 <span class="comment"> * Determine if any of stdin, stdout, or stderr should be linked to pipes </span>
<a name="l00390"></a>00390 <span class="comment"> * when starting a child process.</span>
<a name="l00391"></a>00391 <span class="comment"> * @param attr The procattr we care about. </span>
<a name="l00392"></a>00392 <span class="comment"> * @param in Should stdin be a pipe back to the parent?</span>
<a name="l00393"></a>00393 <span class="comment"> * @param out Should stdout be a pipe back to the parent?</span>
<a name="l00394"></a>00394 <span class="comment"> * @param err Should stderr be a pipe back to the parent?</span>
<a name="l00395"></a>00395 <span class="comment"> */</span>
<a name="l00396"></a>00396 <a class="code" href="group__apr__platform.html#g4a5cbc739c4e19ab450020163d0899d4">APR_DECLARE</a>(<a class="code" href="group__apr__errno.html#g4cf2ddae3efce70c508ac7fefc1c47f7">apr_status_t</a>) <a class="code" href="group__apr__thread__proc.html#g2418e8558bc60fb3832f522f103eadce">apr_procattr_io_set</a>(apr_procattr_t *attr, 
<a name="l00397"></a>00397                                              apr_int32_t in, apr_int32_t out,
<a name="l00398"></a>00398                                              apr_int32_t err);
<a name="l00399"></a>00399 <span class="comment"></span>
<a name="l00400"></a>00400 <span class="comment">/**</span>
<a name="l00401"></a>00401 <span class="comment"> * Set the child_in and/or parent_in values to existing apr_file_t values.</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 child_in apr_file_t value to use as child_in. Must be a valid file.</span>
<a name="l00404"></a>00404 <span class="comment"> * @param parent_in apr_file_t value to use as parent_in. Must be a valid file.</span>
<a name="l00405"></a>00405 <span class="comment"> * @remark  This is NOT a required initializer function. This is</span>
<a name="l00406"></a>00406 <span class="comment"> *          useful if you have already opened a pipe (or multiple files)</span>
<a name="l00407"></a>00407 <span class="comment"> *          that you wish to use, perhaps persistently across multiple</span>
<a name="l00408"></a>00408 <span class="comment"> *          process invocations - such as a log file. You can save some </span>
<a name="l00409"></a>00409 <span class="comment"> *          extra function calls by not creating your own pipe since this</span>
<a name="l00410"></a>00410 <span class="comment"> *          creates one in the process space for you.</span>
<a name="l00411"></a>00411 <span class="comment"> */</span>
<a name="l00412"></a>00412 <a class="code" href="group__apr__platform.html#g4a5cbc739c4e19ab450020163d0899d4">APR_DECLARE</a>(<a class="code" href="group__apr__errno.html#g4cf2ddae3efce70c508ac7fefc1c47f7">apr_status_t</a>) <a class="code" href="group__apr__thread__proc.html#g8af87ccdcf98e335096cde30235dc81d">apr_procattr_child_in_set</a>(struct apr_procattr_t *attr,
<a name="l00413"></a>00413                                                   <a class="code" href="group__apr__file__io.html#g804ab64a6f58ddcc3da8d9f54b6f51c2">apr_file_t</a> *child_in,
<a name="l00414"></a>00414                                                   <a class="code" href="group__apr__file__io.html#g804ab64a6f58ddcc3da8d9f54b6f51c2">apr_file_t</a> *parent_in);
<a name="l00415"></a>00415 <span class="comment"></span>
<a name="l00416"></a>00416 <span class="comment">/**</span>
<a name="l00417"></a>00417 <span class="comment"> * Set the child_out and parent_out values to existing apr_file_t values.</span>
<a name="l00418"></a>00418 <span class="comment"> * @param attr The procattr we care about. </span>
<a name="l00419"></a>00419 <span class="comment"> * @param child_out apr_file_t value to use as child_out. Must be a valid file.</span>
<a name="l00420"></a>00420 <span class="comment"> * @param parent_out apr_file_t value to use as parent_out. Must be a valid file.</span>
<a name="l00421"></a>00421 <span class="comment"> * @remark This is NOT a required initializer function. This is</span>
<a name="l00422"></a>00422 <span class="comment"> *         useful if you have already opened a pipe (or multiple files)</span>
<a name="l00423"></a>00423 <span class="comment"> *         that you wish to use, perhaps persistently across multiple</span>
<a name="l00424"></a>00424 <span class="comment"> *         process invocations - such as a log file. </span>
<a name="l00425"></a>00425 <span class="comment"> */</span>
<a name="l00426"></a>00426 <a class="code" href="group__apr__platform.html#g4a5cbc739c4e19ab450020163d0899d4">APR_DECLARE</a>(<a class="code" href="group__apr__errno.html#g4cf2ddae3efce70c508ac7fefc1c47f7">apr_status_t</a>) <a class="code" href="group__apr__thread__proc.html#g0127f691fb4e1ba3b25116bf49ecb782">apr_procattr_child_out_set</a>(struct apr_procattr_t *attr,
<a name="l00427"></a>00427                                                    <a class="code" href="group__apr__file__io.html#g804ab64a6f58ddcc3da8d9f54b6f51c2">apr_file_t</a> *child_out,
<a name="l00428"></a>00428                                                    <a class="code" href="group__apr__file__io.html#g804ab64a6f58ddcc3da8d9f54b6f51c2">apr_file_t</a> *parent_out);
<a name="l00429"></a>00429 <span class="comment"></span>
<a name="l00430"></a>00430 <span class="comment">/**</span>
<a name="l00431"></a>00431 <span class="comment"> * Set the child_err and parent_err values to existing apr_file_t values.</span>
<a name="l00432"></a>00432 <span class="comment"> * @param attr The procattr we care about. </span>
<a name="l00433"></a>00433 <span class="comment"> * @param child_err apr_file_t value to use as child_err. Must be a valid file.</span>
<a name="l00434"></a>00434 <span class="comment"> * @param parent_err apr_file_t value to use as parent_err. Must be a valid file.</span>
<a name="l00435"></a>00435 <span class="comment"> * @remark This is NOT a required initializer function. This is</span>
<a name="l00436"></a>00436 <span class="comment"> *         useful if you have already opened a pipe (or multiple files)</span>
<a name="l00437"></a>00437 <span class="comment"> *         that you wish to use, perhaps persistently across multiple</span>
<a name="l00438"></a>00438 <span class="comment"> *         process invocations - such as a log file. </span>
<a name="l00439"></a>00439 <span class="comment"> */</span>
<a name="l00440"></a>00440 <a class="code" href="group__apr__platform.html#g4a5cbc739c4e19ab450020163d0899d4">APR_DECLARE</a>(<a class="code" href="group__apr__errno.html#g4cf2ddae3efce70c508ac7fefc1c47f7">apr_status_t</a>) <a class="code" href="group__apr__thread__proc.html#g325e07e29e6988f311bd71d8cc7245bc">apr_procattr_child_err_set</a>(struct apr_procattr_t *attr,
<a name="l00441"></a>00441                                                    <a class="code" href="group__apr__file__io.html#g804ab64a6f58ddcc3da8d9f54b6f51c2">apr_file_t</a> *child_err,
<a name="l00442"></a>00442                                                    <a class="code" href="group__apr__file__io.html#g804ab64a6f58ddcc3da8d9f54b6f51c2">apr_file_t</a> *parent_err);
<a name="l00443"></a>00443 <span class="comment"></span>
<a name="l00444"></a>00444 <span class="comment">/**</span>
<a name="l00445"></a>00445 <span class="comment"> * Set which directory the child process should start executing in.</span>
<a name="l00446"></a>00446 <span class="comment"> * @param attr The procattr we care about. </span>
<a name="l00447"></a>00447 <span class="comment"> * @param dir Which dir to start in.  By default, this is the same dir as</span>
<a name="l00448"></a>00448 <span class="comment"> *            the parent currently resides in, when the createprocess call</span>
<a name="l00449"></a>00449 <span class="comment"> *            is made. </span>
<a name="l00450"></a>00450 <span class="comment"> */</span>
<a name="l00451"></a>00451 <a class="code" href="group__apr__platform.html#g4a5cbc739c4e19ab450020163d0899d4">APR_DECLARE</a>(<a class="code" href="group__apr__errno.html#g4cf2ddae3efce70c508ac7fefc1c47f7">apr_status_t</a>) <a class="code" href="group__apr__thread__proc.html#g76decbbb8baa6d538a9dbf045c8737de">apr_procattr_dir_set</a>(apr_procattr_t *attr, 
<a name="l00452"></a>00452                                               const <span class="keywordtype">char</span> *dir);
<a name="l00453"></a>00453 <span class="comment"></span>
<a name="l00454"></a>00454 <span class="comment">/**</span>
<a name="l00455"></a>00455 <span class="comment"> * Set what type of command the child process will call.</span>
<a name="l00456"></a>00456 <span class="comment"> * @param attr The procattr we care about. </span>
<a name="l00457"></a>00457 <span class="comment"> * @param cmd The type of command.  One of:</span>
<a name="l00458"></a>00458 <span class="comment"> * &lt;PRE&gt;</span>
<a name="l00459"></a>00459 <span class="comment"> *            APR_SHELLCMD     --  Anything that the shell can handle</span>
<a name="l00460"></a>00460 <span class="comment"> *            APR_PROGRAM      --  Executable program   (default) </span>
<a name="l00461"></a>00461 <span class="comment"> *            APR_PROGRAM_ENV  --  Executable program, copy environment</span>
<a name="l00462"></a>00462 <span class="comment"> *            APR_PROGRAM_PATH --  Executable program on PATH, copy env</span>
<a name="l00463"></a>00463 <span class="comment"> * &lt;/PRE&gt;</span>
<a name="l00464"></a>00464 <span class="comment"> */</span>
<a name="l00465"></a>00465 <a class="code" href="group__apr__platform.html#g4a5cbc739c4e19ab450020163d0899d4">APR_DECLARE</a>(<a class="code" href="group__apr__errno.html#g4cf2ddae3efce70c508ac7fefc1c47f7">apr_status_t</a>) <a class="code" href="group__apr__thread__proc.html#g641310702269e750b4382fc3c16cc15c">apr_procattr_cmdtype_set</a>(apr_procattr_t *attr,
<a name="l00466"></a>00466                                                   apr_cmdtype_e cmd);
<a name="l00467"></a>00467 <span class="comment"></span>
<a name="l00468"></a>00468 <span class="comment">/**</span>
<a name="l00469"></a>00469 <span class="comment"> * Determine if the child should start in detached state.</span>
<a name="l00470"></a>00470 <span class="comment"> * @param attr The procattr we care about. </span>
<a name="l00471"></a>00471 <span class="comment"> * @param detach Should the child start in detached state?  Default is no. </span>
<a name="l00472"></a>00472 <span class="comment"> */</span>
<a name="l00473"></a>00473 <a class="code" href="group__apr__platform.html#g4a5cbc739c4e19ab450020163d0899d4">APR_DECLARE</a>(<a class="code" href="group__apr__errno.html#g4cf2ddae3efce70c508ac7fefc1c47f7">apr_status_t</a>) <a class="code" href="group__apr__thread__proc.html#ge19fabe4255ad04d01d54a170676e1fe">apr_procattr_detach_set</a>(apr_procattr_t *attr, 
<a name="l00474"></a>00474                                                  apr_int32_t detach);
<a name="l00475"></a>00475 
<a name="l00476"></a>00476 <span class="preprocessor">#if APR_HAVE_STRUCT_RLIMIT</span>
<a name="l00477"></a>00477 <span class="preprocessor"></span><span class="comment">/**</span>
<a name="l00478"></a>00478 <span class="comment"> * Set the Resource Utilization limits when starting a new process.</span>
<a name="l00479"></a>00479 <span class="comment"> * @param attr The procattr we care about. </span>
<a name="l00480"></a>00480 <span class="comment"> * @param what Which limit to set, one of:</span>
<a name="l00481"></a>00481 <span class="comment"> * &lt;PRE&gt;</span>
<a name="l00482"></a>00482 <span class="comment"> *                 APR_LIMIT_CPU</span>
<a name="l00483"></a>00483 <span class="comment"> *                 APR_LIMIT_MEM</span>
<a name="l00484"></a>00484 <span class="comment"> *                 APR_LIMIT_NPROC</span>
<a name="l00485"></a>00485 <span class="comment"> *                 APR_LIMIT_NOFILE</span>
<a name="l00486"></a>00486 <span class="comment"> * &lt;/PRE&gt;</span>
<a name="l00487"></a>00487 <span class="comment"> * @param limit Value to set the limit to.</span>
<a name="l00488"></a>00488 <span class="comment"> */</span>
<a name="l00489"></a>00489 <a class="code" href="group__apr__platform.html#g4a5cbc739c4e19ab450020163d0899d4">APR_DECLARE</a>(<a class="code" href="group__apr__errno.html#g4cf2ddae3efce70c508ac7fefc1c47f7">apr_status_t</a>) <a class="code" href="group__apr__thread__proc.html#gf6129b92cfbcf07113ed6eeb2b4517e6">apr_procattr_limit_set</a>(apr_procattr_t *attr, 
<a name="l00490"></a>00490                                                 apr_int32_t what,
<a name="l00491"></a>00491                                                 struct rlimit *limit);
<a name="l00492"></a>00492 <span class="preprocessor">#endif</span>
<a name="l00493"></a>00493 <span class="preprocessor"></span><span class="comment"></span>
<a name="l00494"></a>00494 <span class="comment">/**</span>
<a name="l00495"></a>00495 <span class="comment"> * Specify an error function to be called in the child process if APR</span>
<a name="l00496"></a>00496 <span class="comment"> * encounters an error in the child prior to running the specified program.</span>
<a name="l00497"></a>00497 <span class="comment"> * @param attr The procattr describing the child process to be created.</span>
<a name="l00498"></a>00498 <span class="comment"> * @param errfn The function to call in the child process.</span>
<a name="l00499"></a>00499 <span class="comment"> * @remark At the present time, it will only be called from apr_proc_create()</span>
<a name="l00500"></a>00500 <span class="comment"> *         on platforms where fork() is used.  It will never be called on other</span>
<a name="l00501"></a>00501 <span class="comment"> *         platforms, on those platforms apr_proc_create() will return the error</span>
<a name="l00502"></a>00502 <span class="comment"> *         in the parent process rather than invoke the callback in the now-forked</span>
<a name="l00503"></a>00503 <span class="comment"> *         child process.</span>
<a name="l00504"></a>00504 <span class="comment"> */</span>
<a name="l00505"></a>00505 <a class="code" href="group__apr__platform.html#g4a5cbc739c4e19ab450020163d0899d4">APR_DECLARE</a>(<a class="code" href="group__apr__errno.html#g4cf2ddae3efce70c508ac7fefc1c47f7">apr_status_t</a>) <a class="code" href="group__apr__thread__proc.html#g97d912c0294625622669ff30debf77bc">apr_procattr_child_errfn_set</a>(apr_procattr_t *attr,
<a name="l00506"></a>00506                                                        <a class="code" href="group__apr__thread__proc.html#gcccc80278bd5ac4f635f20a58498ed37">apr_child_errfn_t</a> *errfn);
<a name="l00507"></a>00507 <span class="comment"></span>
<a name="l00508"></a>00508 <span class="comment">/**</span>
<a name="l00509"></a>00509 <span class="comment"> * Specify that apr_proc_create() should do whatever it can to report</span>
<a name="l00510"></a>00510 <span class="comment"> * failures to the caller of apr_proc_create(), rather than find out in</span>
<a name="l00511"></a>00511 <span class="comment"> * the child.</span>
<a name="l00512"></a>00512 <span class="comment"> * @param attr The procattr describing the child process to be created.</span>
<a name="l00513"></a>00513 <span class="comment"> * @param chk Flag to indicate whether or not extra work should be done</span>
<a name="l00514"></a>00514 <span class="comment"> *            to try to report failures to the caller.</span>
<a name="l00515"></a>00515 <span class="comment"> * @remark This flag only affects apr_proc_create() on platforms where</span>
<a name="l00516"></a>00516 <span class="comment"> *         fork() is used.  This leads to extra overhead in the calling</span>
<a name="l00517"></a>00517 <span class="comment"> *         process, but that may help the application handle such</span>
<a name="l00518"></a>00518 <span class="comment"> *         errors more gracefully.</span>
<a name="l00519"></a>00519 <span class="comment"> */</span>
<a name="l00520"></a>00520 <a class="code" href="group__apr__platform.html#g4a5cbc739c4e19ab450020163d0899d4">APR_DECLARE</a>(<a class="code" href="group__apr__errno.html#g4cf2ddae3efce70c508ac7fefc1c47f7">apr_status_t</a>) <a class="code" href="group__apr__thread__proc.html#g0d72d15aff3dae8fca454486a08a1ee6">apr_procattr_error_check_set</a>(apr_procattr_t *attr,
<a name="l00521"></a>00521                                                        apr_int32_t chk);
<a name="l00522"></a>00522 <span class="comment"></span>
<a name="l00523"></a>00523 <span class="comment">/**</span>
<a name="l00524"></a>00524 <span class="comment"> * Determine if the child should start in its own address space or using the </span>
<a name="l00525"></a>00525 <span class="comment"> * current one from its parent</span>
<a name="l00526"></a>00526 <span class="comment"> * @param attr The procattr we care about. </span>
<a name="l00527"></a>00527 <span class="comment"> * @param addrspace Should the child start in its own address space?  Default</span>
<a name="l00528"></a>00528 <span class="comment"> *                  is no on NetWare and yes on other platforms.</span>
<a name="l00529"></a>00529 <span class="comment"> */</span>
<a name="l00530"></a>00530 <a class="code" href="group__apr__platform.html#g4a5cbc739c4e19ab450020163d0899d4">APR_DECLARE</a>(<a class="code" href="group__apr__errno.html#g4cf2ddae3efce70c508ac7fefc1c47f7">apr_status_t</a>) <a class="code" href="group__apr__thread__proc.html#g9ef4c06ced65b18035607158c9fc132e">apr_procattr_addrspace_set</a>(apr_procattr_t *attr,
<a name="l00531"></a>00531                                                        apr_int32_t addrspace);
<a name="l00532"></a>00532 <span class="comment"></span>
<a name="l00533"></a>00533 <span class="comment">/**</span>
<a name="l00534"></a>00534 <span class="comment"> * Set the username used for running process</span>
<a name="l00535"></a>00535 <span class="comment"> * @param attr The procattr we care about. </span>
<a name="l00536"></a>00536 <span class="comment"> * @param username The username used</span>
<a name="l00537"></a>00537 <span class="comment"> * @param password User password if needed. Password is needed on WIN32</span>
<a name="l00538"></a>00538 <span class="comment"> *                 or any other platform having</span>
<a name="l00539"></a>00539 <span class="comment"> *                 APR_PROCATTR_USER_SET_REQUIRES_PASSWORD set.</span>
<a name="l00540"></a>00540 <span class="comment"> */</span>
<a name="l00541"></a>00541 <a class="code" href="group__apr__platform.html#g4a5cbc739c4e19ab450020163d0899d4">APR_DECLARE</a>(<a class="code" href="group__apr__errno.html#g4cf2ddae3efce70c508ac7fefc1c47f7">apr_status_t</a>) <a class="code" href="group__apr__thread__proc.html#g1339824fa56f33f2b8059717beb46657">apr_procattr_user_set</a>(apr_procattr_t *attr,
<a name="l00542"></a>00542                                                 const <span class="keywordtype">char</span> *username,
<a name="l00543"></a>00543                                                 const <span class="keywordtype">char</span> *password);
<a name="l00544"></a>00544 <span class="comment"></span>
<a name="l00545"></a>00545 <span class="comment">/**</span>
<a name="l00546"></a>00546 <span class="comment"> * Set the group used for running process</span>
<a name="l00547"></a>00547 <span class="comment"> * @param attr The procattr we care about. </span>
<a name="l00548"></a>00548 <span class="comment"> * @param groupname The group name  used</span>
<a name="l00549"></a>00549 <span class="comment"> */</span>
<a name="l00550"></a>00550 <a class="code" href="group__apr__platform.html#g4a5cbc739c4e19ab450020163d0899d4">APR_DECLARE</a>(<a class="code" href="group__apr__errno.html#g4cf2ddae3efce70c508ac7fefc1c47f7">apr_status_t</a>) <a class="code" href="group__apr__thread__proc.html#gb190824624fff359b784532d5a361a57">apr_procattr_group_set</a>(apr_procattr_t *attr,
<a name="l00551"></a>00551                                                  const <span class="keywordtype">char</span> *groupname);
<a name="l00552"></a>00552 
<a name="l00553"></a>00553 
<a name="l00554"></a>00554 <span class="preprocessor">#if APR_HAS_FORK</span>
<a name="l00555"></a>00555 <span class="preprocessor"></span><span class="comment">/**</span>
<a name="l00556"></a>00556 <span class="comment"> * This is currently the only non-portable call in APR.  This executes </span>
<a name="l00557"></a>00557 <span class="comment"> * a standard unix fork.</span>
<a name="l00558"></a>00558 <span class="comment"> * @param proc The resulting process handle. </span>
<a name="l00559"></a>00559 <span class="comment"> * @param cont The pool to use. </span>
<a name="l00560"></a>00560 <span class="comment"> * @remark returns APR_INCHILD for the child, and APR_INPARENT for the parent</span>
<a name="l00561"></a>00561 <span class="comment"> * or an error.</span>
<a name="l00562"></a>00562 <span class="comment"> */</span>
<a name="l00563"></a>00563 <a class="code" href="group__apr__platform.html#g4a5cbc739c4e19ab450020163d0899d4">APR_DECLARE</a>(<a class="code" href="group__apr__errno.html#g4cf2ddae3efce70c508ac7fefc1c47f7">apr_status_t</a>) <a class="code" href="group__apr__thread__proc.html#g31c290d7e76dfa07e2970801d49784fc">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#g06f17a7732f2d04d8ce7010fbb057a8b">apr_pool_t</a> *cont);
<a name="l00564"></a>00564 <span class="preprocessor">#endif</span>
<a name="l00565"></a>00565 <span class="preprocessor"></span><span class="comment"></span>
<a name="l00566"></a>00566 <span class="comment">/**</span>
<a name="l00567"></a>00567 <span class="comment"> * Create a new process and execute a new program within that process.</span>
<a name="l00568"></a>00568 <span class="comment"> * @param new_proc The resulting process handle.</span>
<a name="l00569"></a>00569 <span class="comment"> * @param progname The program to run </span>
<a name="l00570"></a>00570 <span class="comment"> * @param args the arguments to pass to the new program.  The first </span>
<a name="l00571"></a>00571 <span class="comment"> *             one should be the program name.</span>
<a name="l00572"></a>00572 <span class="comment"> * @param env The new environment table for the new process.  This </span>
<a name="l00573"></a>00573 <span class="comment"> *            should be a list of NULL-terminated strings. This argument</span>
<a name="l00574"></a>00574 <span class="comment"> *            is ignored for APR_PROGRAM_ENV, APR_PROGRAM_PATH, and</span>
<a name="l00575"></a>00575 <span class="comment"> *            APR_SHELLCMD_ENV types of commands.</span>
<a name="l00576"></a>00576 <span class="comment"> * @param attr the procattr we should use to determine how to create the new</span>
<a name="l00577"></a>00577 <span class="comment"> *         process</span>
<a name="l00578"></a>00578 <span class="comment"> * @param pool The pool to use.</span>
<a name="l00579"></a>00579 <span class="comment"> * @note This function returns without waiting for the new process to terminate;</span>
<a name="l00580"></a>00580 <span class="comment"> * use apr_proc_wait for that.</span>
<a name="l00581"></a>00581 <span class="comment"> */</span>
<a name="l00582"></a>00582 <a class="code" href="group__apr__platform.html#g4a5cbc739c4e19ab450020163d0899d4">APR_DECLARE</a>(<a class="code" href="group__apr__errno.html#g4cf2ddae3efce70c508ac7fefc1c47f7">apr_status_t</a>) <a class="code" href="group__apr__thread__proc.html#g2616e2fea866a2912dadfeafcc789397">apr_proc_create</a>(<a class="code" href="structapr__proc__t.html">apr_proc_t</a> *new_proc,
<a name="l00583"></a>00583                                           const <span class="keywordtype">char</span> *progname,
<a name="l00584"></a>00584                                           const <span class="keywordtype">char</span> * const *args,
<a name="l00585"></a>00585                                           const <span class="keywordtype">char</span> * const *env, 
<a name="l00586"></a>00586                                           apr_procattr_t *attr, 
<a name="l00587"></a>00587                                           <a class="code" href="group__apr__pools.html#g06f17a7732f2d04d8ce7010fbb057a8b">apr_pool_t</a> *pool);
<a name="l00588"></a>00588 <span class="comment"></span>
<a name="l00589"></a>00589 <span class="comment">/**</span>
<a name="l00590"></a>00590 <span class="comment"> * Wait for a child process to die</span>
<a name="l00591"></a>00591 <span class="comment"> * @param proc The process handle that corresponds to the desired child process </span>
<a name="l00592"></a>00592 <span class="comment"> * @param exitcode The returned exit status of the child, if a child process </span>
<a name="l00593"></a>00593 <span class="comment"> *                 dies, or the signal that caused the child to die.</span>
<a name="l00594"></a>00594 <span class="comment"> *                 On platforms that don't support obtaining this information, </span>
<a name="l00595"></a>00595 <span class="comment"> *                 the status parameter will be returned as APR_ENOTIMPL.</span>
<a name="l00596"></a>00596 <span class="comment"> * @param exitwhy Why the child died, the bitwise or of:</span>
<a name="l00597"></a>00597 <span class="comment"> * &lt;PRE&gt;</span>
<a name="l00598"></a>00598 <span class="comment"> *            APR_PROC_EXIT         -- process terminated normally</span>
<a name="l00599"></a>00599 <span class="comment"> *            APR_PROC_SIGNAL       -- process was killed by a signal</span>
<a name="l00600"></a>00600 <span class="comment"> *            APR_PROC_SIGNAL_CORE  -- process was killed by a signal, and</span>
<a name="l00601"></a>00601 <span class="comment"> *                                     generated a core dump.</span>
<a name="l00602"></a>00602 <span class="comment"> * &lt;/PRE&gt;</span>
<a name="l00603"></a>00603 <span class="comment"> * @param waithow How should we wait.  One of:</span>
<a name="l00604"></a>00604 <span class="comment"> * &lt;PRE&gt;</span>
<a name="l00605"></a>00605 <span class="comment"> *            APR_WAIT   -- block until the child process dies.</span>
<a name="l00606"></a>00606 <span class="comment"> *            APR_NOWAIT -- return immediately regardless of if the </span>
<a name="l00607"></a>00607 <span class="comment"> *                          child is dead or not.</span>
<a name="l00608"></a>00608 <span class="comment"> * &lt;/PRE&gt;</span>
<a name="l00609"></a>00609 <span class="comment"> * @remark The childs status is in the return code to this process.  It is one of:</span>
<a name="l00610"></a>00610 <span class="comment"> * &lt;PRE&gt;</span>
<a name="l00611"></a>00611 <span class="comment"> *            APR_CHILD_DONE     -- child is no longer running.</span>
<a name="l00612"></a>00612 <span class="comment"> *            APR_CHILD_NOTDONE  -- child is still running.</span>
<a name="l00613"></a>00613 <span class="comment"> * &lt;/PRE&gt;</span>
<a name="l00614"></a>00614 <span class="comment"> */</span>
<a name="l00615"></a>00615 <a class="code" href="group__apr__platform.html#g4a5cbc739c4e19ab450020163d0899d4">APR_DECLARE</a>(<a class="code" href="group__apr__errno.html#g4cf2ddae3efce70c508ac7fefc1c47f7">apr_status_t</a>) <a class="code" href="group__apr__thread__proc.html#gbf437b4b325ad8217a3fb79db772ee5a">apr_proc_wait</a>(<a class="code" href="structapr__proc__t.html">apr_proc_t</a> *proc,
<a name="l00616"></a>00616                                         <span class="keywordtype">int</span> *exitcode, <a class="code" href="group__apr__thread__proc.html#gf76f239c21f01710fa0d24c467dbee3c">apr_exit_why_e</a> *exitwhy,
<a name="l00617"></a>00617                                         apr_wait_how_e waithow);
<a name="l00618"></a>00618 <span class="comment"></span>
<a name="l00619"></a>00619 <span class="comment">/**</span>
<a name="l00620"></a>00620 <span class="comment"> * Wait for any current child process to die and return information </span>
<a name="l00621"></a>00621 <span class="comment"> * about that child.</span>
<a name="l00622"></a>00622 <span class="comment"> * @param proc Pointer to NULL on entry, will be filled out with child's </span>
<a name="l00623"></a>00623 <span class="comment"> *             information </span>
<a name="l00624"></a>00624 <span class="comment"> * @param exitcode The returned exit status of the child, if a child process </span>
<a name="l00625"></a>00625 <span class="comment"> *                 dies, or the signal that caused the child to die.</span>
<a name="l00626"></a>00626 <span class="comment"> *                 On platforms that don't support obtaining this information, </span>
<a name="l00627"></a>00627 <span class="comment"> *                 the status parameter will be returned as APR_ENOTIMPL.</span>
<a name="l00628"></a>00628 <span class="comment"> * @param exitwhy Why the child died, the bitwise or of:</span>
<a name="l00629"></a>00629 <span class="comment"> * &lt;PRE&gt;</span>
<a name="l00630"></a>00630 <span class="comment"> *            APR_PROC_EXIT         -- process terminated normally</span>
<a name="l00631"></a>00631 <span class="comment"> *            APR_PROC_SIGNAL       -- process was killed by a signal</span>
<a name="l00632"></a>00632 <span class="comment"> *            APR_PROC_SIGNAL_CORE  -- process was killed by a signal, and</span>
<a name="l00633"></a>00633 <span class="comment"> *                                     generated a core dump.</span>
<a name="l00634"></a>00634 <span class="comment"> * &lt;/PRE&gt;</span>
<a name="l00635"></a>00635 <span class="comment"> * @param waithow How should we wait.  One of:</span>
<a name="l00636"></a>00636 <span class="comment"> * &lt;PRE&gt;</span>
<a name="l00637"></a>00637 <span class="comment"> *            APR_WAIT   -- block until the child process dies.</span>
<a name="l00638"></a>00638 <span class="comment"> *            APR_NOWAIT -- return immediately regardless of if the </span>
<a name="l00639"></a>00639 <span class="comment"> *                          child is dead or not.</span>
<a name="l00640"></a>00640 <span class="comment"> * &lt;/PRE&gt;</span>
<a name="l00641"></a>00641 <span class="comment"> * @param p Pool to allocate child information out of.</span>
<a name="l00642"></a>00642 <span class="comment"> * @bug Passing proc as a *proc rather than **proc was an odd choice</span>
<a name="l00643"></a>00643 <span class="comment"> * for some platforms... this should be revisited in 1.0</span>
<a name="l00644"></a>00644 <span class="comment"> */</span>
<a name="l00645"></a>00645 <a class="code" href="group__apr__platform.html#g4a5cbc739c4e19ab450020163d0899d4">APR_DECLARE</a>(<a class="code" href="group__apr__errno.html#g4cf2ddae3efce70c508ac7fefc1c47f7">apr_status_t</a>) <a class="code" href="group__apr__thread__proc.html#g0931b4c5b7560cfca08634fd8369f7e5">apr_proc_wait_all_procs</a>(<a class="code" href="structapr__proc__t.html">apr_proc_t</a> *proc,
<a name="l00646"></a>00646                                                   <span class="keywordtype">int</span> *exitcode,
<a name="l00647"></a>00647                                                   <a class="code" href="group__apr__thread__proc.html#gf76f239c21f01710fa0d24c467dbee3c">apr_exit_why_e</a> *exitwhy,
<a name="l00648"></a>00648                                                   apr_wait_how_e waithow,
<a name="l00649"></a>00649                                                   <a class="code" href="group__apr__pools.html#g06f17a7732f2d04d8ce7010fbb057a8b">apr_pool_t</a> *p);
<a name="l00650"></a>00650 
<a name="l00651"></a><a class="code" href="group__apr__thread__proc.html#g626a651cb148e3213708540e792b4f7c">00651</a> <span class="preprocessor">#define APR_PROC_DETACH_FOREGROUND 0    </span><span class="comment">/**&lt; Do not detach */</span>
<a name="l00652"></a><a class="code" href="group__apr__thread__proc.html#g7120f10b0fe0609ddeb6025b4ac38bc1">00652</a> <span class="preprocessor">#define APR_PROC_DETACH_DAEMONIZE 1     </span><span class="comment">/**&lt; Detach */</span>
<a name="l00653"></a>00653 <span class="comment"></span>
<a name="l00654"></a>00654 <span class="comment">/**</span>
<a name="l00655"></a>00655 <span class="comment"> * Detach the process from the controlling terminal.</span>
<a name="l00656"></a>00656 <span class="comment"> * @param daemonize set to non-zero if the process should daemonize</span>
<a name="l00657"></a>00657 <span class="comment"> *                  and become a background process, else it will</span>
<a name="l00658"></a>00658 <span class="comment"> *                  stay in the foreground.</span>
<a name="l00659"></a>00659 <span class="comment"> */</span>
<a name="l00660"></a>00660 <a class="code" href="group__apr__platform.html#g4a5cbc739c4e19ab450020163d0899d4">APR_DECLARE</a>(<a class="code" href="group__apr__errno.html#g4cf2ddae3efce70c508ac7fefc1c47f7">apr_status_t</a>) <a class="code" href="group__apr__thread__proc.html#g13e93bf4106d9f683bb1297883eebe18">apr_proc_detach</a>(<span class="keywordtype">int</span> daemonize);
<a name="l00661"></a>00661 <span class="comment"></span>
<a name="l00662"></a>00662 <span class="comment">/**</span>
<a name="l00663"></a>00663 <span class="comment"> * Register an other_child -- a child associated to its registered </span>
<a name="l00664"></a>00664 <span class="comment"> * maintence callback.  This callback is invoked when the process</span>
<a name="l00665"></a>00665 <span class="comment"> * dies, is disconnected or disappears.</span>
<a name="l00666"></a>00666 <span class="comment"> * @param proc The child process to register.</span>
<a name="l00667"></a>00667 <span class="comment"> * @param maintenance maintenance is a function that is invoked with a </span>
<a name="l00668"></a>00668 <span class="comment"> *                    reason and the data pointer passed here.</span>
<a name="l00669"></a>00669 <span class="comment"> * @param data Opaque context data passed to the maintenance function.</span>
<a name="l00670"></a>00670 <span class="comment"> * @param write_fd An fd that is probed for writing.  If it is ever unwritable</span>
<a name="l00671"></a>00671 <span class="comment"> *                 then the maintenance is invoked with reason </span>
<a name="l00672"></a>00672 <span class="comment"> *                 OC_REASON_UNWRITABLE.</span>
<a name="l00673"></a>00673 <span class="comment"> * @param p The pool to use for allocating memory.</span>
<a name="l00674"></a>00674 <span class="comment"> * @bug write_fd duplicates the proc-&gt;out stream, it's really redundant</span>
<a name="l00675"></a>00675 <span class="comment"> * and should be replaced in the APR 1.0 API with a bitflag of which</span>
<a name="l00676"></a>00676 <span class="comment"> * proc-&gt;in/out/err handles should be health checked.</span>
<a name="l00677"></a>00677 <span class="comment"> * @bug no platform currently tests the pipes health.</span>
<a name="l00678"></a>00678 <span class="comment"> */</span>
<a name="l00679"></a>00679 <a class="code" href="group__apr__platform.html#g4a5cbc739c4e19ab450020163d0899d4">APR_DECLARE</a>(<span class="keywordtype">void</span>) <a class="code" href="group__apr__thread__proc.html#g1da65dfcf0db5a162cc41a4fefd9b9dd">apr_proc_other_child_register</a>(<a class="code" href="structapr__proc__t.html">apr_proc_t</a> *proc, 
<a name="l00680"></a>00680                                            <span class="keywordtype">void</span> (*maintenance) (<span class="keywordtype">int</span> reason, 
<a name="l00681"></a>00681                                                                 <span class="keywordtype">void</span> *, 
<a name="l00682"></a>00682                                                                 <span class="keywordtype">int</span> status),
<a name="l00683"></a>00683                                            <span class="keywordtype">void</span> *data, <a class="code" href="group__apr__file__io.html#g804ab64a6f58ddcc3da8d9f54b6f51c2">apr_file_t</a> *write_fd,
<a name="l00684"></a>00684                                            <a class="code" href="group__apr__pools.html#g06f17a7732f2d04d8ce7010fbb057a8b">apr_pool_t</a> *p);
<a name="l00685"></a>00685 <span class="comment"></span>
<a name="l00686"></a>00686 <span class="comment">/**</span>
<a name="l00687"></a>00687 <span class="comment"> * Stop watching the specified other child.  </span>
<a name="l00688"></a>00688 <span class="comment"> * @param data The data to pass to the maintenance function.  This is</span>
<a name="l00689"></a>00689 <span class="comment"> *             used to find the process to unregister.</span>
<a name="l00690"></a>00690 <span class="comment"> * @warning Since this can be called by a maintenance function while we're</span>
<a name="l00691"></a>00691 <span class="comment"> *          scanning the other_children list, all scanners should protect </span>
<a name="l00692"></a>00692 <span class="comment"> *          themself by loading ocr-&gt;next before calling any maintenance </span>
<a name="l00693"></a>00693 <span class="comment"> *          function.</span>
<a name="l00694"></a>00694 <span class="comment"> */</span>
<a name="l00695"></a>00695 <a class="code" href="group__apr__platform.html#g4a5cbc739c4e19ab450020163d0899d4">APR_DECLARE</a>(<span class="keywordtype">void</span>) <a class="code" href="group__apr__thread__proc.html#g06cae596004a51204e56e54b1eb8812f">apr_proc_other_child_unregister</a>(<span class="keywordtype">void</span> *data);
<a name="l00696"></a>00696 <span class="comment"></span>
<a name="l00697"></a>00697 <span class="comment">/**</span>
<a name="l00698"></a>00698 <span class="comment"> * Notify the maintenance callback of a registered other child process</span>
<a name="l00699"></a>00699 <span class="comment"> * that application has detected an event, such as death.</span>
<a name="l00700"></a>00700 <span class="comment"> * @param proc The process to check</span>
<a name="l00701"></a>00701 <span class="comment"> * @param reason The reason code to pass to the maintenance function</span>
<a name="l00702"></a>00702 <span class="comment"> * @param status The status to pass to the maintenance function</span>
<a name="l00703"></a>00703 <span class="comment"> * @remark An example of code using this behavior;</span>
<a name="l00704"></a>00704 <span class="comment"> * &lt;pre&gt;</span>
<a name="l00705"></a>00705 <span class="comment"> * rv = apr_proc_wait_all_procs(&amp;proc, &amp;exitcode, &amp;status, APR_WAIT, p);</span>
<a name="l00706"></a>00706 <span class="comment"> * if (APR_STATUS_IS_CHILD_DONE(rv)) {</span>
<a name="l00707"></a>00707 <span class="comment"> * #if APR_HAS_OTHER_CHILD</span>
<a name="l00708"></a>00708 <span class="comment"> *     if (apr_proc_other_child_alert(&amp;proc, APR_OC_REASON_DEATH, status)</span>
<a name="l00709"></a>00709 <span class="comment"> *             == APR_SUCCESS) {</span>
<a name="l00710"></a>00710 <span class="comment"> *         ;  (already handled)</span>
<a name="l00711"></a>00711 <span class="comment"> *     }</span>
<a name="l00712"></a>00712 <span class="comment"> *     else</span>
<a name="l00713"></a>00713 <span class="comment"> * #endif</span>
<a name="l00714"></a>00714 <span class="comment"> *         [... handling non-otherchild processes death ...]</span>
<a name="l00715"></a>00715 <span class="comment"> * &lt;/pre&gt;</span>
<a name="l00716"></a>00716 <span class="comment"> */</span>
<a name="l00717"></a>00717 <a class="code" href="group__apr__platform.html#g4a5cbc739c4e19ab450020163d0899d4">APR_DECLARE</a>(<a class="code" href="group__apr__errno.html#g4cf2ddae3efce70c508ac7fefc1c47f7">apr_status_t</a>) <a class="code" href="group__apr__thread__proc.html#g054507fc1a009e7e406977de8ff2430e">apr_proc_other_child_alert</a>(<a class="code" href="structapr__proc__t.html">apr_proc_t</a> *proc, 
<a name="l00718"></a>00718                                                      <span class="keywordtype">int</span> reason,
<a name="l00719"></a>00719                                                      <span class="keywordtype">int</span> status);
<a name="l00720"></a>00720 <span class="comment"></span>
<a name="l00721"></a>00721 <span class="comment">/**</span>
<a name="l00722"></a>00722 <span class="comment"> * Test one specific other child processes and invoke the maintenance callback </span>
<a name="l00723"></a>00723 <span class="comment"> * with the appropriate reason code, if still running, or the appropriate reason </span>
<a name="l00724"></a>00724 <span class="comment"> * code if the process is no longer healthy.</span>
<a name="l00725"></a>00725 <span class="comment"> * @param ocr The registered other child</span>
<a name="l00726"></a>00726 <span class="comment"> * @param reason The reason code (e.g. APR_OC_REASON_RESTART) if still running</span>
<a name="l00727"></a>00727 <span class="comment"> */</span>
<a name="l00728"></a>00728 <a class="code" href="group__apr__platform.html#g4a5cbc739c4e19ab450020163d0899d4">APR_DECLARE</a>(<span class="keywordtype">void</span>) <a class="code" href="group__apr__thread__proc.html#g78033aa95f75af00bad433acd7d0edbd">apr_proc_other_child_refresh</a>(apr_other_child_rec_t *ocr,
<a name="l00729"></a>00729                                                <span class="keywordtype">int</span> reason);
<a name="l00730"></a>00730 <span class="comment"></span>
<a name="l00731"></a>00731 <span class="comment">/**</span>
<a name="l00732"></a>00732 <span class="comment"> * Test all registered other child processes and invoke the maintenance callback </span>
<a name="l00733"></a>00733 <span class="comment"> * with the appropriate reason code, if still running, or the appropriate reason </span>
<a name="l00734"></a>00734 <span class="comment"> * code if the process is no longer healthy.</span>
<a name="l00735"></a>00735 <span class="comment"> * @param reason The reason code (e.g. APR_OC_REASON_RESTART) to running processes</span>
<a name="l00736"></a>00736 <span class="comment"> */</span>
<a name="l00737"></a>00737 <a class="code" href="group__apr__platform.html#g4a5cbc739c4e19ab450020163d0899d4">APR_DECLARE</a>(<span class="keywordtype">void</span>) <a class="code" href="group__apr__thread__proc.html#g1f971a706308c53c388cd936e62e7738">apr_proc_other_child_refresh_all</a>(<span class="keywordtype">int</span> reason);
<a name="l00738"></a>00738 <span class="comment"></span>
<a name="l00739"></a>00739 <span class="comment">/** </span>
<a name="l00740"></a>00740 <span class="comment"> * Terminate a process.</span>
<a name="l00741"></a>00741 <span class="comment"> * @param proc The process to terminate.</span>
<a name="l00742"></a>00742 <span class="comment"> * @param sig How to kill the process.</span>
<a name="l00743"></a>00743 <span class="comment"> */</span>
<a name="l00744"></a>00744 <a class="code" href="group__apr__platform.html#g4a5cbc739c4e19ab450020163d0899d4">APR_DECLARE</a>(<a class="code" href="group__apr__errno.html#g4cf2ddae3efce70c508ac7fefc1c47f7">apr_status_t</a>) <a class="code" href="group__apr__thread__proc.html#g9b254ce7876389f7b618d9cb5ddee84b">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="l00745"></a>00745 <span class="comment"></span>
<a name="l00746"></a>00746 <span class="comment">/**</span>
<a name="l00747"></a>00747 <span class="comment"> * Register a process to be killed when a pool dies.</span>
<a name="l00748"></a>00748 <span class="comment"> * @param a The pool to use to define the processes lifetime </span>
<a name="l00749"></a>00749 <span class="comment"> * @param proc The process to register</span>
<a name="l00750"></a>00750 <span class="comment"> * @param how How to kill the process, one of:</span>
<a name="l00751"></a>00751 <span class="comment"> * &lt;PRE&gt;</span>
<a name="l00752"></a>00752 <span class="comment"> *         APR_KILL_NEVER         -- process is never sent any signals</span>
<a name="l00753"></a>00753 <span class="comment"> *         APR_KILL_ALWAYS        -- process is sent SIGKILL on apr_pool_t cleanup</span>
<a name="l00754"></a>00754 <span class="comment"> *         APR_KILL_AFTER_TIMEOUT -- SIGTERM, wait 3 seconds, SIGKILL</span>
<a name="l00755"></a>00755 <span class="comment"> *         APR_JUST_WAIT          -- wait forever for the process to complete</span>
<a name="l00756"></a>00756 <span class="comment"> *         APR_KILL_ONLY_ONCE     -- send SIGTERM and then wait</span>
<a name="l00757"></a>00757 <span class="comment"> * &lt;/PRE&gt;</span>
<a name="l00758"></a>00758 <span class="comment"> */</span>
<a name="l00759"></a>00759 <a class="code" href="group__apr__platform.html#g4a5cbc739c4e19ab450020163d0899d4">APR_DECLARE</a>(<span class="keywordtype">void</span>) <a class="code" href="group__apr__thread__proc.html#gb440c12171ad01a830802c52fe5bb86b">apr_pool_note_subprocess</a>(<a class="code" href="group__apr__pools.html#g06f17a7732f2d04d8ce7010fbb057a8b">apr_pool_t</a> *a, <a class="code" href="structapr__proc__t.html">apr_proc_t</a> *proc,
<a name="l00760"></a>00760                                            apr_kill_conditions_e how);
<a name="l00761"></a>00761 
<a name="l00762"></a>00762 <span class="preprocessor">#if APR_HAS_THREADS </span>
<a name="l00763"></a>00763 <span class="preprocessor"></span>
<a name="l00764"></a>00764 <span class="preprocessor">#if (APR_HAVE_SIGWAIT || APR_HAVE_SIGSUSPEND) &amp;&amp; !defined(OS2)</span>
<a name="l00765"></a>00765 <span class="preprocessor"></span><span class="comment"></span>
<a name="l00766"></a>00766 <span class="comment">/**</span>
<a name="l00767"></a>00767 <span class="comment"> * Setup the process for a single thread to be used for all signal handling.</span>
<a name="l00768"></a>00768 <span class="comment"> * @warning This must be called before any threads are created</span>
<a name="l00769"></a>00769 <span class="comment"> */</span>
<a name="l00770"></a>00770 <a class="code" href="group__apr__platform.html#g4a5cbc739c4e19ab450020163d0899d4">APR_DECLARE</a>(<a class="code" href="group__apr__errno.html#g4cf2ddae3efce70c508ac7fefc1c47f7">apr_status_t</a>) <a class="code" href="group__apr__thread__proc.html#gfa42fb9137de9a4dbe0a38f7a95eb4b7">apr_setup_signal_thread</a>(<span class="keywordtype">void</span>);
<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"> * Make the current thread listen for signals.  This thread will loop</span>
<a name="l00774"></a>00774 <span class="comment"> * forever, calling a provided function whenever it receives a signal.  That</span>
<a name="l00775"></a>00775 <span class="comment"> * functions should return 1 if the signal has been handled, 0 otherwise.</span>
<a name="l00776"></a>00776 <span class="comment"> * @param signal_handler The function to call when a signal is received</span>
<a name="l00777"></a>00777 <span class="comment"> * apr_status_t apr_signal_thread((int)(*signal_handler)(int signum))</span>
<a name="l00778"></a>00778 <span class="comment"> */</span>
<a name="l00779"></a>00779 <a class="code" href="group__apr__platform.html#g4a5cbc739c4e19ab450020163d0899d4">APR_DECLARE</a>(<a class="code" href="group__apr__errno.html#g4cf2ddae3efce70c508ac7fefc1c47f7">apr_status_t</a>) <a class="code" href="group__apr__thread__proc.html#gad3999b1b2467a8602923d76dfb94a29">apr_signal_thread</a>(<span class="keywordtype">int</span>(*signal_handler)(<span class="keywordtype">int</span> signum));
<a name="l00780"></a>00780 
<a name="l00781"></a>00781 <span class="preprocessor">#endif </span><span class="comment">/* (APR_HAVE_SIGWAIT || APR_HAVE_SIGSUSPEND) &amp;&amp; !defined(OS2) */</span>
<a name="l00782"></a>00782 <span class="comment"></span>
<a name="l00783"></a>00783 <span class="comment">/**</span>
<a name="l00784"></a>00784 <span class="comment"> * Get the child-pool used by the thread from the thread info.</span>
<a name="l00785"></a>00785 <span class="comment"> * @return apr_pool_t the pool</span>
<a name="l00786"></a>00786 <span class="comment"> */</span>
<a name="l00787"></a>00787 <a class="code" href="group__apr__pools.html#g6dda96940d296b27a1bc98d9f49735e4">APR_POOL_DECLARE_ACCESSOR</a>(thread);
<a name="l00788"></a>00788 
<a name="l00789"></a>00789 <span class="preprocessor">#endif </span><span class="comment">/* APR_HAS_THREADS */</span>
<a name="l00790"></a>00790 <span class="comment"></span>
<a name="l00791"></a>00791 <span class="comment">/** @} */</span>
<a name="l00792"></a>00792 
<a name="l00793"></a>00793 <span class="preprocessor">#ifdef __cplusplus</span>
<a name="l00794"></a>00794 <span class="preprocessor"></span>}
<a name="l00795"></a>00795 <span class="preprocessor">#endif</span>
<a name="l00796"></a>00796 <span class="preprocessor"></span>
<a name="l00797"></a>00797 <span class="preprocessor">#endif  </span><span class="comment">/* ! APR_THREAD_PROC_H */</span>
<a name="l00798"></a>00798 
</pre></div><hr size="1"><address style="align: right;"><small>Generated on Tue May 31 12:43:38 2011 for Apache Portable Runtime by&nbsp;
<a href="http://www.doxygen.org/index.html">
<img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.4.7 </small></address>
</body>
</html>