<?xml version="1.0" encoding="windows-1252"?>
<node id="794982" title="Re: Signals in Strawberry Perl: Name or number?" created="2009-09-13 06:52:29" updated="2009-09-13 06:52:29">
<type id="11">
note</type>
<author id="747201">
afoken</author>
<data>
<field name="doctext">
&lt;p&gt;Strawberry Perl runs on Windows. Windows does not have signals. POSIX systems like Linux have signals.&lt;/p&gt;
&lt;p&gt;Perl emulates some minor aspects of &lt;c&gt;kill()&lt;/c&gt; on Windows, but you can't expect the emulation to be perfect.&lt;/p&gt;
&lt;p&gt;From [doc://perlport]:&lt;/p&gt;
&lt;blockquote&gt;
&lt;c&gt;kill()&lt;/c&gt; doesn't have the semantics of &lt;c&gt;raise()&lt;/c&gt;, i.e. it doesn't send a signal to the identified process like it does on Unix platforms. Instead &lt;c&gt;kill($sig, $pid)&lt;/c&gt; terminates the process identified by &lt;c&gt;$pid&lt;/c&gt;, and makes it exit immediately with exit status &lt;c&gt;$sig&lt;/c&gt;. As in Unix, if &lt;c&gt;$sig&lt;/c&gt; is 0 and the specified process exists, it returns true without actually terminating it. (Win32)
&lt;/blockquote&gt;
&lt;blockquote&gt;
&lt;c&gt;kill(-9, $pid)&lt;/c&gt; will terminate the process specified by &lt;c&gt;$pid&lt;/c&gt; and recursively all child processes owned by it. This is different from the Unix semantics, where the signal will be delivered to all processes in the same process group as the process specified by &lt;c&gt;$pid&lt;/c&gt;. (Win32)
&lt;/blockquote&gt;
&lt;p&gt;From [doc://perlwin32]:&lt;/p&gt;
&lt;blockquote&gt;
Signal handling may not behave as on Unix platforms (where it doesn't exactly "behave", either :). For instance, calling &lt;c&gt;die()&lt;/c&gt; or &lt;c&gt;exit()&lt;/c&gt; from signal handlers will cause an exception, since most implementations of &lt;c&gt;signal()&lt;/c&gt; on Win32 are severely crippled. Thus, signals may work only for simple things like setting a flag variable in the handler. Using signals under this port should currently be considered unsupported.
&lt;/blockquote&gt;
&lt;p&gt;Alexander&lt;/p&gt;
&lt;div class="pmsig"&gt;&lt;div class="pmsig-747201"&gt;
--&lt;br&gt;
Today I will gladly share my knowledge and experience, for there are no sweeter words than "I told you so". ;-)
&lt;/div&gt;&lt;/div&gt;</field>
<field name="root_node">
794938</field>
<field name="parent_node">
794938</field>
</data>
</node>
