posix_get_last_error
Description
The posix_get_last_error of POSIX for PHP retrieves the error number set by the last posix function that failed.
Syntax
posix_get_last_error(): int
Return
Returns the errno (error number) set by the last posix function that failed. If no errors exist, 0 is returned.
Examples
1 · void · 0
<?php $return = posix_get_last_error(); echo $return;
0
2 · void · 1
<?php $process_id = 100; $signal = SIGKILL; posix_kill($process_id, $signal); $return = posix_get_last_error(); echo $return;
1
3 · void · 3
<?php $process_id = 100000; $signal = SIGKILL; posix_kill($process_id, $signal); $return = posix_get_last_error(); echo $return;
3
4 · void · 13
<?php $filename = $_SERVER['DOCUMENT_ROOT'] . '/assets/txt/1.txt'; $flags = POSIX_X_OK; posix_access($filename, $flags); $return = posix_get_last_error(); echo $return;
13
Links
POSIX
- posix_access
- posix_ctermid
- posix_eaccess
- posix_errno
- posix_fpathconf
- posix_getcwd
- posix_getegid
- posix_geteuid
- posix_getgid
- posix_getgrgid
- posix_getgrnam
- posix_getgroups
- posix_getlogin
- posix_getpgid
- posix_getpgrp
- posix_getpid
- posix_getppid
- posix_getpwnam
- posix_getpwuid
- posix_getrlimit
- posix_getsid
- posix_getuid
- posix_initgroups
- posix_isatty
- posix_kill
- posix_mkfifo
- posix_mknod
- posix_pathconf
- posix_setegid
- posix_seteuid
- posix_setgid
- posix_setpgid
- posix_setrlimit
- posix_setsid
- posix_setuid
- posix_strerror
- posix_sysconf
- posix_times
- posix_ttyname
- posix_uname