uTools-Manuals/docs/php/proc_close.html
2019-04-08 23:22:26 +08:00

73 lines
2.9 KiB
HTML

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<title>关闭由 proc_open 打开的进程并且返回进程退出码</title>
</head>
<body class="docs"><div id="layout">
<div id="layout-content"><div id="function.proc-close" class="refentry">
<div class="refnamediv">
<h1 class="refname">proc_close</h1>
<p class="verinfo">(PHP 4 &gt;= 4.3.0, PHP 5, PHP 7)</p><p class="refpurpose"><span class="refname">proc_close</span> &mdash; <span class="dc-title">关闭由 <span class="function"><a href="proc_open.html" class="function">proc_open()</a></span> 打开的进程并且返回进程退出码</span></p>
</div>
<div class="refsect1 description" id="refsect1-function.proc-close-description">
<h3 class="title">说明</h3>
<div class="methodsynopsis dc-description">
<span class="methodname"><strong>proc_close</strong></span>
( <span class="methodparam"><span class="type">resource</span> <code class="parameter">$process</code></span>
) : <span class="type">int</span></div>
<p class="para rdfs-comment">
<span class="function"><strong>proc_close()</strong></span><span class="function"><a href="pclose.html" class="function">pclose()</a></span> 函数类似,
只是 <span class="function"><strong>proc_close()</strong></span>
只能用来关闭由 <span class="function"><a href="proc_open.html" class="function">proc_open()</a></span> 函数打开的进程。
<span class="function"><strong>proc_close()</strong></span> 函数会等待进程终止,
并且返回进程的返回值。
如果有连接到进程的已经打开的管道,
那么需要在调用此函数之前调用 <span class="function"><a href="fclose.html" class="function">fclose()</a></span> 函数来关闭管道,
否则会引发死锁 - 在管道处于打开状态时,子进程将不能退出。
</p>
</div>
<div class="refsect1 parameters" id="refsect1-function.proc-close-parameters">
<h3 class="title">参数</h3>
<p class="para">
<dl>
<dt>
<code class="parameter">process</code></dt>
<dd>
<p class="para">
要关闭的由 <span class="function"><a href="proc_open.html" class="function">proc_open()</a></span> 打开的 <span class="type"><a href="language.types.resource.html" class="type resource">resource</a></span>
</p>
</dd>
</dl>
</p>
</div>
<div class="refsect1 returnvalues" id="refsect1-function.proc-close-returnvalues">
<h3 class="title">返回值</h3>
<p class="para">
返回进程的终止状态码。
如果发生错误,将返回 <em>-1</em>
</p>
<blockquote class="note"><p><strong class="note">Note</strong>:
<p class="para">
If PHP has been compiled with --enable-sigchild, the return value of this function is undefined.
</p>
</p></blockquote>
</div>
</div></div></div></body></html>