posix_get_last_error

(PHP 4 >= 4.2.0, PHP 5)

posix_get_last_error -- Retrieve the error number set by the last posix function that failed

Description

int posix_get_last_error ( void )

Retrieve the error number set by the last posix function that failed. If you're wanting the system error message associated with the errno, use posix_strerror().

Return Values

Returns the errno (error number) set by the last posix function that failed. If no errors exist, 0 is returned.

Examples

Example 1. posix_get_last_error() example

This example attempt to kill a bogus process id, which will set the last error. We will then print out the last error.

<?php
posix_kill
(999459,SIGKILL);
echo
'Your error returned was '.posix_get_last_error(); //Your error was ___
?>


Follow phpf1 on Twitter




F1 Site Family
AJAX F1
CSS F1
Database F1
Flash F1
HTML F1
Java F1
JavaScript F1
PhotoShop F1
PHP F1
Scripts F1
Tutorial F1
Windows F1

Total time: 0.0413