Req #78700 [NEW]: support posix strsignal(int signo)
| From: | divinity76+spam at gmail dot com | Date: | Sun, 20 Oct 2019 09:56:30 +0000 |
| Subject: | Req #78700 [NEW]: support posix strsignal(int signo) | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-223316@lists.php.net to get a copy of this message | ||
From: divinity76+spam at gmail dot com
Operating system: POSIX
PHP version: Next Minor Version
Package: POSIX related
Bug Type: Feature/Change Request
Bug description:support posix strsignal(int signo)
Description:
------------
Posix has a function called strsignal(), since at least POSIX.1-2008,
docs can be found here
https://pubs.opengroup.org/onlinepubs/9699919799/functions/strsignal.html
but the TL;DR is that it converts a signal to it's signal name (like in
Linux, signal 15 is SIGTERM, and it converts int(15) to
string("SIGTERM"))
would be nice if the posix extension could add support for it.
a naive-ish userland implementation can be found at
https://stackoverflow.com/a/58471626/1067003
(i don't know if the userland implementation is error-free, and it does
not use the posix strsignal() function, but at least it appears to work)
Test script:
---------------
<?php
var_dump(posix_strsignal(SIGTERM));
Expected result:
----------------
string(7) "SIGTERM"
Actual result:
--------------
PHP Fatal error: Uncaught Error: Call to undefined function
posix_strsignal() in /foo.php:3
Stack trace:
#0 {main}
thrown in /jail/home/foo.php on line 3
--
Edit bug report at https://bugs.php.net/bug.php?id=78700&edit=1
--
Fix committed: https://bugs.php.net/fix.php?id=78700&r=fixed
Fixed in release: https://bugs.php.net/fix.php?id=78700&r=alreadyfixed
Need backtrace: https://bugs.php.net/fix.php?id=78700&r=needtrace
Need Reproduce Script: https://bugs.php.net/fix.php?id=78700&r=needscript
Try newer version: https://bugs.php.net/fix.php?id=78700&r=oldversion
Not developer issue: https://bugs.php.net/fix.php?id=78700&r=support
Expected behavior: https://bugs.php.net/fix.php?id=78700&r=notwrong
Not enough info: https://bugs.php.net/fix.php?id=78700&r=notenoughinfo
Submitted twice: https://bugs.php.net/fix.php?id=78700&r=submittedtwice
register_globals: https://bugs.php.net/fix.php?id=78700&r=globals
PHP version support discontinued: https://bugs.php.net/fix.php?id=78700&r=phptooold
Daylight Savings: https://bugs.php.net/fix.php?id=78700&r=dst
IIS Stability: https://bugs.php.net/fix.php?id=78700&r=isapi
Install GNU Sed: https://bugs.php.net/fix.php?id=78700&r=gnused
Floating point limitations: https://bugs.php.net/fix.php?id=78700&r=float
No Zend Extensions: https://bugs.php.net/fix.php?id=78700&r=nozend
MySQL Configuration Error: https://bugs.php.net/fix.php?id=78700&r=mysqlcfg