<?php
include_once $_SERVER['DOCUMENT_ROOT'] . '/include/shared-manual.inc';
$TOC = array();
$TOC_DEPRECATED = array();
$PARENTS = array();
include_once dirname(__FILE__) ."/toc/ref.posix.inc";
$setup = array (
  'home' => 
  array (
    0 => 'index.php',
    1 => 'PHP Manual',
  ),
  'head' => 
  array (
    0 => 'UTF-8',
    1 => 'zh',
  ),
  'this' => 
  array (
    0 => 'function.posix-ttyname.php',
    1 => 'posix_ttyname',
    2 => 'Determine terminal device name',
  ),
  'up' => 
  array (
    0 => 'ref.posix.php',
    1 => 'POSIX 函数',
  ),
  'prev' => 
  array (
    0 => 'function.posix-times.php',
    1 => 'posix_times',
  ),
  'next' => 
  array (
    0 => 'function.posix-uname.php',
    1 => 'posix_uname',
  ),
  'alternatives' => 
  array (
  ),
  'source' => 
  array (
    'lang' => 'en',
    'path' => 'reference/posix/functions/posix-ttyname.xml',
  ),
  'history' => 
  array (
  ),
);
$setup["toc"] = $TOC;
$setup["toc_deprecated"] = $TOC_DEPRECATED;
$setup["parents"] = $PARENTS;
manual_setup($setup);

contributors($setup);

?>
<div id="function.posix-ttyname" class="refentry">
 <div class="refnamediv">
  <h1 class="refname">posix_ttyname</h1>
  <p class="verinfo">(PHP 4, PHP 5, PHP 7, PHP 8)</p><p class="refpurpose"><span class="refname">posix_ttyname</span> &mdash; <span class="dc-title">Determine terminal device name</span></p>

 </div>
 
 <div class="refsect1 description" id="refsect1-function.posix-ttyname-description">
  <h3 class="title">说明</h3>
  <div class="methodsynopsis dc-description">
   <span class="methodname"><strong>posix_ttyname</strong></span>(<span class="methodparam"><span class="type"><span class="type"><a href="language.types.resource.php" class="type resource">resource</a></span>|<span class="type"><a href="language.types.integer.php" class="type int">int</a></span></span> <code class="parameter">$file_descriptor</code></span>): <span class="type"><span class="type"><a href="language.types.string.php" class="type string">string</a></span>|<span class="type"><a href="language.types.singleton.php" class="type false">false</a></span></span></div>

  <p class="para rdfs-comment">
   Returns a <span class="type"><a href="language.types.string.php" class="type string">string</a></span> for the absolute path to the current
   terminal device that is open on the file descriptor
   <code class="parameter">file_descriptor</code>.
  </p>
 </div>


 <div class="refsect1 parameters" id="refsect1-function.posix-ttyname-parameters">
  <h3 class="title">参数</h3>
  <p class="para">
   <dl>
    
 <dt><code class="parameter">file_descriptor</code></dt>
 <dd>
  <p class="para">
   The file descriptor, which is expected to be either a file
   <span class="type"><a href="language.types.resource.php" class="type resource">resource</a></span> or an <span class="type"><a href="language.types.integer.php" class="type int">int</a></span>. An <span class="type"><a href="language.types.integer.php" class="type int">int</a></span>
   will be assumed to be a file descriptor that can be passed directly to
   the underlying system call.
  </p>
 </dd>

   </dl>
  </p>
 </div>


 <div class="refsect1 returnvalues" id="refsect1-function.posix-ttyname-returnvalues">
  <h3 class="title">返回值</h3>
  <p class="para">
   On success, returns a <span class="type"><a href="language.types.string.php" class="type string">string</a></span> of the absolute path of the
   <code class="parameter">file_descriptor</code>. On failure, returns <strong><code><a href="reserved.constants.php#constant.false">false</a></code></strong>
  </p>
 </div>


 <div class="refsect1 errors" id="refsect1-function.posix-ttyname-errors">
  <h3 class="title">错误／异常</h3>
  <p class="para">
   On invalid <code class="parameter">file_descriptor</code> integer values
   an <strong><code><a href="errorfunc.constants.php#constant.e-warning">E_WARNING</a></code></strong> is raised.
  </p>
 </div>


 <div class="refsect1 changelog" id="refsect1-function.posix-ttyname-changelog">
  <h3 class="title">更新日志</h3>
  <table class="doctable informaltable">
   
    <thead>
     <tr>
      <th>版本</th>
      <th>说明</th>
     </tr>

    </thead>

    <tbody class="tbody">
     <tr>
      <td>8.3.0</td>
      <td>
       Type error <strong><code><a href="errorfunc.constants.php#constant.e-warning">E_WARNING</a></code></strong>s are now raised for integer
       coercions following the usual PHP type coercion semantics.
      </td>
     </tr>

     <tr>
      <td>8.3.0</td>
      <td>
       On invalid <code class="parameter">file_descriptor</code> integer values
       an <strong><code><a href="errorfunc.constants.php#constant.e-warning">E_WARNING</a></code></strong> is now raised.
      </td>
     </tr>

    </tbody>
   
  </table>

 </div>


 <div class="refsect1 seealso" id="refsect1-function.posix-ttyname-seealso">
  <h3 class="title">参见</h3>
  <p class="para">
   <ul class="simplelist">
    <li><span class="function"><a href="function.posix-isatty.php" class="function" rel="rdfs-seeAlso">posix_isatty()</a> - Determine if a file descriptor is an interactive terminal</span></li>
    <li><span class="function"><a href="function.stream-isatty.php" class="function" rel="rdfs-seeAlso">stream_isatty()</a> - Check if a stream is a TTY</span></li>
   </ul>
  </p>
 </div>


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