📄 group__apr__thread__proc.html
字号:
</td>
<td>
<p>
Create a new process and execute a new program within that process. <dl compact><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td></td><td valign=top><em>new_proc</em> </td><td>The resulting process handle. </td></tr>
<tr><td></td><td valign=top><em>progname</em> </td><td>The program to run </td></tr>
<tr><td></td><td valign=top><em>args</em> </td><td>the arguments to pass to the new program. The first one should be the program name. </td></tr>
<tr><td></td><td valign=top><em>env</em> </td><td>The new environment table for the new process. This should be a list of NULL-terminated strings. This argument is ignored for APR_PROGRAM_ENV, APR_PROGRAM_PATH, and APR_SHELLCMD_ENV types of commands. </td></tr>
<tr><td></td><td valign=top><em>attr</em> </td><td>the procattr we should use to determine how to create the new process </td></tr>
<tr><td></td><td valign=top><em>pool</em> </td><td>The pool to use. </td></tr>
</table>
</dl>
<dl compact><dt><b>Note:</b></dt><dd>This function returns without waiting for the new process to terminate; use apr_proc_wait for that. </dd></dl>
</td>
</tr>
</table>
<a class="anchor" name="ga45" doxytag="apr_thread_proc.h::apr_proc_detach" ></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top"> <a class="el" href="group__apr__errno.html#ga0">apr_status_t</a> apr_proc_detach </td>
<td class="md" valign="top">( </td>
<td class="md" nowrap valign="top">int </td>
<td class="mdname1" valign="top" nowrap> <em>daemonize</em> </td>
<td class="md" valign="top"> ) </td>
<td class="md" nowrap></td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
<tr>
<td>
</td>
<td>
<p>
Detach the process from the controlling terminal. <dl compact><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td></td><td valign=top><em>daemonize</em> </td><td>set to non-zero if the process should daemonize and become a background process, else it will stay in the foreground. </td></tr>
</table>
</dl>
</td>
</tr>
</table>
<a class="anchor" name="ga51" doxytag="apr_thread_proc.h::apr_proc_kill" ></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top"> <a class="el" href="group__apr__errno.html#ga0">apr_status_t</a> apr_proc_kill </td>
<td class="md" valign="top">( </td>
<td class="md" nowrap valign="top"><a class="el" href="structapr__proc__t.html">apr_proc_t</a> * </td>
<td class="mdname" nowrap> <em>proc</em>, </td>
</tr>
<tr>
<td class="md" nowrap align="right"></td>
<td></td>
<td class="md" nowrap>int </td>
<td class="mdname" nowrap> <em>sig</em></td>
</tr>
<tr>
<td></td>
<td class="md">) </td>
<td class="md" colspan="2"></td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
<tr>
<td>
</td>
<td>
<p>
Terminate a process. <dl compact><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td></td><td valign=top><em>proc</em> </td><td>The process to terminate. </td></tr>
<tr><td></td><td valign=top><em>sig</em> </td><td>How to kill the process. </td></tr>
</table>
</dl>
</td>
</tr>
</table>
<a class="anchor" name="ga48" doxytag="apr_thread_proc.h::apr_proc_other_child_alert" ></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top"> <a class="el" href="group__apr__errno.html#ga0">apr_status_t</a> apr_proc_other_child_alert </td>
<td class="md" valign="top">( </td>
<td class="md" nowrap valign="top"><a class="el" href="structapr__proc__t.html">apr_proc_t</a> * </td>
<td class="mdname" nowrap> <em>proc</em>, </td>
</tr>
<tr>
<td class="md" nowrap align="right"></td>
<td></td>
<td class="md" nowrap>int </td>
<td class="mdname" nowrap> <em>reason</em>, </td>
</tr>
<tr>
<td class="md" nowrap align="right"></td>
<td></td>
<td class="md" nowrap>int </td>
<td class="mdname" nowrap> <em>status</em></td>
</tr>
<tr>
<td></td>
<td class="md">) </td>
<td class="md" colspan="2"></td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
<tr>
<td>
</td>
<td>
<p>
Notify the maintenance callback of a registered other child process that application has detected an event, such as death. <dl compact><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td></td><td valign=top><em>proc</em> </td><td>The process to check </td></tr>
<tr><td></td><td valign=top><em>reason</em> </td><td>The reason code to pass to the maintenance function </td></tr>
<tr><td></td><td valign=top><em>status</em> </td><td>The status to pass to the maintenance function </td></tr>
</table>
</dl>
<dl compact><dt><b>Remarks:</b></dt><dd>An example of code using this behavior; <pre>
rv = apr_proc_wait_all_procs(&proc, &exitcode, &status, APR_WAIT, p);
if (<a class="el" href="group___a_p_r___s_t_a_t_u_s___i_s.html#ga30">APR_STATUS_IS_CHILD_DONE(rv)</a>) {
#if APR_HAS_OTHER_CHILD
if (apr_proc_other_child_alert(&proc, APR_OC_REASON_DEATH, status)
== APR_SUCCESS) {
; (already handled)
}
else
#endif
[... handling non-otherchild processes death ...]
</pre> </dd></dl>
</td>
</tr>
</table>
<a class="anchor" name="ga49" doxytag="apr_thread_proc.h::apr_proc_other_child_refresh" ></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top"> void apr_proc_other_child_refresh </td>
<td class="md" valign="top">( </td>
<td class="md" nowrap valign="top"><a class="el" href="group__apr__thread__proc.html#ga7">apr_other_child_rec_t</a> * </td>
<td class="mdname" nowrap> <em>ocr</em>, </td>
</tr>
<tr>
<td class="md" nowrap align="right"></td>
<td></td>
<td class="md" nowrap>int </td>
<td class="mdname" nowrap> <em>reason</em></td>
</tr>
<tr>
<td></td>
<td class="md">) </td>
<td class="md" colspan="2"></td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
<tr>
<td>
</td>
<td>
<p>
Test one specific other child processes and invoke the maintenance callback with the appropriate reason code, if still running, or the appropriate reason code if the process is no longer healthy. <dl compact><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td></td><td valign=top><em>ocr</em> </td><td>The registered other child </td></tr>
<tr><td></td><td valign=top><em>reason</em> </td><td>The reason code (e.g. APR_OC_REASON_RESTART) if still running </td></tr>
</table>
</dl>
</td>
</tr>
</table>
<a class="anchor" name="ga50" doxytag="apr_thread_proc.h::apr_proc_other_child_refresh_all" ></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top"> void apr_proc_other_child_refresh_all </td>
<td class="md" valign="top">( </td>
<td class="md" nowrap valign="top">int </td>
<td class="mdname1" valign="top" nowrap> <em>reason</em> </td>
<td class="md" valign="top"> ) </td>
<td class="md" nowrap></td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
<tr>
<td>
</td>
<td>
<p>
Test all registered other child processes and invoke the maintenance callback with the appropriate reason code, if still running, or the appropriate reason code if the process is no longer healthy. <dl compact><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td></td><td valign=top><em>reason</em> </td><td>The reason code (e.g. APR_OC_REASON_RESTART) to running processes </td></tr>
</table>
</dl>
</td>
</tr>
</table>
<a class="anchor" name="ga46" doxytag="apr_thread_proc.h::apr_proc_other_child_register" ></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top"> void apr_proc_other_child_register </td>
<td class="md" valign="top">( </td>
<td class="md" nowrap valign="top"><a class="el" href="structapr__proc__t.html">apr_proc_t</a> * </td>
<td class="mdname" nowrap> <em>proc</em>, </td>
</tr>
<tr>
<td class="md" nowrap align="right"></td>
<td></td>
<td class="md" nowrap>void(* </td>
<td class="mdname" nowrap> <em>mainten
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -