PHP
downloads | documentation | faq | getting help | mailing lists | licenses | wiki | reporting bugs | php.net sites | links | conferences | my php.net

search for in the

posix_getcwd> <posix_ctermid
Last updated: Fri, 30 Jan 2009

view this page in

posix_get_last_error

(PHP 4 >= 4.2.0, PHP 5)

posix_get_last_error直近で失敗した posix 関数が設定したエラー番号を取得する

説明

int posix_get_last_error ( void )

直近で失敗した posix 関数が設定したエラー番号を取得します。 エラー番号に対応するエラーメッセージを取得するには posix_strerror() を使用します。

返り値

直近で失敗した posix 関数が設定した errno (エラー番号) を返します。 エラーが発生していない場合は 0 が返されます。

例1 posix_get_last_error() の例

この例では、存在しないプロセス ID のプロセスを殺そうとしています。 その結果として発生したエラーの番号を表示します。

<?php
posix_kill
(999459,SIGKILL);
echo 
'エラーが返されました。エラー番号: '.posix_get_last_error(); //Your error was ___
?>

参考

  • posix_strerror() - 指定したエラー番号に対応するシステムのエラーメッセージを取得する



add a note add a note User Contributed Notes
posix_get_last_error
There are no user contributed notes for this page.

posix_getcwd> <posix_ctermid
Last updated: Fri, 30 Jan 2009
 
 
show source | credits | sitemap | contact | advertising | mirror sites