array ( 0 => 'index.php', 1 => 'PHP Manual', ), 'head' => array ( 0 => 'UTF-8', 1 => 'ja', ), 'this' => array ( 0 => 'function.posix-ctermid.php', 1 => 'posix_ctermid', ), 'up' => array ( 0 => 'ref.posix.php', 1 => 'POSIX 関数', ), 'prev' => array ( 0 => 'function.posix-access.php', 1 => 'posix_access', ), 'next' => array ( 0 => 'function.posix-eaccess.php', 1 => 'posix_eaccess', ), 'alternatives' => array ( ), 'source' => array ( 'lang' => 'ja', 'path' => 'reference/posix/functions/posix-ctermid.xml', ), ); $setup["toc"] = $TOC; $setup["toc_deprecated"] = $TOC_DEPRECATED; $setup["parents"] = $PARENTS; manual_setup($setup); ?>
(PHP 4, PHP 5, PHP 7, PHP 8)
posix_ctermid — 制御する端末のパス名を得る
そのプロセスで現在制御している端末のパス名を表す文字列を作成します。 エラーが発生した場合は errno を設定します。この値を調べるには posix_get_last_error() を使用します。
この関数にはパラメータはありません。
処理に成功した場合は、現在制御している端末のパス名を表す文字列を返します。
それ以外の場合は false
を返し、errno を設定します。
この値を調べるには posix_get_last_error() を使用します。
例1 posix_ctermid() の例
この例は、現在の TTY へのパスを表示します。
<?php
echo "I am running from ".posix_ctermid();
?>