note 35626 deleted from function.posix-kill by nlopess
| From: | nlopess@php.net | Date: | Fri, 23 Feb 2007 16:58:15 +0000 |
| Subject: | note 35626 deleted from function.posix-kill by nlopess | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-123778@lists.php.net to get a copy of this message | ||
Note Submitter: jack at net-md dot net
----
the signal NAME number mapping seems to be missing (not defined)
so the easy way to grab this info is something like:
egrep '^#define[[:space:]]SIG' /usr/include/asm/signal.h <- for linux
egrep '^#define[[:space:]]SIG' /usr/include/sys/signal.h <- for freebsd
The signals may not the same across all unix'es so be warned. also kill -l
may be the easy awnser (depending on your shell type, bash and ksh seem
to work) Here is an example:
<?
define("SIGTERM",15); /* from /usr/include/asm/signal.h: *
* #define SIGTERM 15 */
$mypid=posix_getpid();
print "killing: ".$mypid."\n";
posix_kill($mypid, SIGTERM);
?>
The example might be silly, but its usefull for batch programs that need
to terminate/notify processes.