<?php
include_once $_SERVER['DOCUMENT_ROOT'] . '/include/shared-manual.inc';
$TOC = array();
$TOC_DEPRECATED = array();
$PARENTS = array();
include_once dirname(__FILE__) ."/toc/ref.exec.inc";
$setup = array (
  'home' => 
  array (
    0 => 'index.php',
    1 => 'PHP Manual',
  ),
  'head' => 
  array (
    0 => 'UTF-8',
    1 => 'zh',
  ),
  'this' => 
  array (
    0 => 'function.proc-close.php',
    1 => 'proc_close',
    2 => '关闭由 proc_open 打开的进程并且返回进程退出码',
  ),
  'up' => 
  array (
    0 => 'ref.exec.php',
    1 => '程序执行函数',
  ),
  'prev' => 
  array (
    0 => 'function.passthru.php',
    1 => 'passthru',
  ),
  'next' => 
  array (
    0 => 'function.proc-get-status.php',
    1 => 'proc_get_status',
  ),
  'alternatives' => 
  array (
  ),
  'source' => 
  array (
    'lang' => 'zh',
    'path' => 'reference/exec/functions/proc-close.xml',
  ),
  'history' => 
  array (
  ),
);
$setup["toc"] = $TOC;
$setup["toc_deprecated"] = $TOC_DEPRECATED;
$setup["parents"] = $PARENTS;
manual_setup($setup);

contributors($setup);

?>
<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, PHP 8)</p><p class="refpurpose"><span class="refname">proc_close</span> &mdash; <span class="dc-title">关闭由 <span class="function"><a href="function.proc-open.php" 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"><a href="language.types.resource.php" class="type resource">resource</a></span> <code class="parameter">$process</code></span>): <span class="type"><a href="language.types.integer.php" class="type int">int</a></span></div>

  <p class="para rdfs-comment">
    <span class="function"><strong>proc_close()</strong></span> 同 <span class="function"><a href="function.pclose.php" class="function">pclose()</a></span> 函数类似，只是
    <span class="function"><strong>proc_close()</strong></span> 只能用来关闭由 <span class="function"><a href="function.proc-open.php" class="function">proc_open()</a></span>
    函数打开的进程。<span class="function"><strong>proc_close()</strong></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="function.proc-open.php" class="function">proc_open()</a></span> 打开的 <span class="type"><a href="language.types.resource.php" 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">
    返回进程的终止状态码。
    如果发生错误，将返回  <code class="literal">-1</code>。
  </p>
  <blockquote class="note"><p><strong class="note">注意</strong>: 
 <p class="para">
  如果 PHP 是通过 --enable-sigchild 编译的，此函数将没有返回值。
 </p>
</p></blockquote>

 </div>


</div><?php manual_footer($setup); ?>