windoze/ruby/signals - egads!

A

ara.t.howard

anyone understand why this just dumps EINVAL errors on windoze?


cat:~ > cat a.rb
program = <<-ruby
puts $$

require 'logger'
logger = Logger.new STDERR
Signal.list.keys.each do |sig|
begin
trap sig do
puts("trap: %s" % sig)
end
rescue Exception => e
logger.info{ e }
end
end
ruby

require 'logger'
logger = Logger.new STDERR
pipe = IO.popen 'ruby', 'r+'
pipe.puts program
pipe.close_write
pid = pipe.gets.strip.to_i
puts pid


Signal.list.keys.each do |sig|
next if sig == 'KILL'
begin
STDERR.puts "#{ sig } => #{ pid }"
Process.kill sig, pid
rescue Exception => e
logger.info{ e }
end
end


of course i can send 'KILL', but every other signal simply raises
EINVAL?? works fine on other platforms...

cheers.

a @ http://codeforpeople.com/
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,770
Messages
2,569,584
Members
45,075
Latest member
MakersCBDBloodSupport

Latest Threads

Top