text: Details
  - Type:
  Bug
  - Status:
  Resolved
  - Priority:
  Major
  - Resolution: Fixed
  - Affects Version/s: JRuby 1.7.0.pre2
  - Fix Version/s: JRuby 1.7.0.RC1
  - Component/s: Core Classes/Modules
  - Labels:None
  - Environment:jruby 1.7.0.preview2 (1.9.3p203) 2012-08-07 4a6bb0a on Java HotSpot(TM) Client VM 1.7.0_05-b05 [Windows 7-x86]
  - Number of attachments :
  Description
  It seems that the Signal.list is missing "KILL" on Windows:
  # MRI irb(main):001:0> Signal.list.keys => ["EXIT", "INT", "ILL", "ABRT", "FPE", "KILL", "SEGV", "TERM"] # JRuby irb(main):001:0> Signal.list.keys => ["INT", "ILL", "ABRT", "FPE", "SEGV", "TERM", "EXIT"]
  Activity
  jnr-constants is here:
  The logic for generating the constants is in gen/ and has templates in gen/const/. Signal.rb there basically says what .h file to load (signal.h) and has a list of signal names to attempt to generate.
  So I guess my question is whether SIGKILL is defined in signal.h on Windows. If it is, something's wrong with our generation logic. If it is not, we need some other way to get SIGKILL's value for jnr-constants.
  Looks like it's being hard coded in include\ruby\win32.h
  #ifndef SIGINT #define SIGINT 2 #endif #ifndef SIGKILL #define SIGKILL 9 #endif
  In my copy of signal.h with VC 10, SIGINT is defined but SIGKILL is not. Why? I have no idea.
  Ok...so I think what we can do is require 'win32.h' since that seems to be the only place to get SIGKILL and SIGINT on Windows, and I will hand-define them in jnr-constants for release with JRuby 1.7RC1.
  Correction....SIGINT does seem to be defined correctly already.
  Fixed on jnr-constants master. Still needs release with JRuby 1.7RC1.
  commit f8fa3a5f1d5ddf143875c5278e0f9bd4c4ba8b05 Author: Charles Oliver Nutter <headius@headius.com> Date: Thu Aug 23 11:49:32 2012 -0500 Add win32.h and SIGKILL for Windows (JRUBY-6855) :100644 100644 564f261... 73e752d... M gen/const/Signal.rb :100644 100644 897803b... 692da90... M src/main/java/jnr/constants/platform/windows/Signal.java
  now if it only actually did anything with those signals, on windows, anyway...
  Appears fixed:
  >> Signal.list['KILL']
  => 9
  with
  "jruby 1.7.0.RC1 (1.9.3p203) 2012-09-26 52678af on Java HotSpot(TM) Client VM 1.6.0_35-b10 [Windows 7-x86]"
  Thanks for the confirmation.
  Our list of signals is generated from the jnr-constants library, which basically has per-platform generated code to provide constant values.
  Looking at jnr-constants, I see this in the Windows Signal constants: // SIGKILL not defined
  This should be programmatically generated based on what's available at compile time, so I'm confused why KILL doesn't show up if it's actually supposed to be there.