Laurent Julliard <laurent / moldus.org> wrote in message news:<419D23F6.5020802 / moldus.org>...
> Daniel Berger wrote:
> > Laurent Julliard <Laurent.Julliard / xrce.xerox.com> wrote in message news:<419C6073.5090200 / xrce.xerox.com>...
> > 
> >>I'm having serious troubles with Process.kill on 1.8.2 preview2 or
> >>1.8.1. Whenever I try to issue a Process.kill(sig,pid) there is an
> >>exception raised:
> >>
> >>in kill: invalid argument (Errno::EINVAL)
> >>
> >>I looked at the source code (rb_f_kill in signal.c) and it is *not* an
> >>error that relates to the sig and pid arguments which are OK but it
> >>looks like this is an error returned by the kill system call on Windows
> >>
> >>Any idea why this doesn't work? (I'm using the Ruby one-click
> >>installer compiled with VS C++ 7)
> >>
> >>Thanks for your help
> >>
> >>Laurent
> > 
> > 
> > You're looking in the wrong place.  Take a look at win32.c, which is
> > where Process.kill is defined for Win32.  The only named signals it
> > understands are SIGINT and SIGKILL.  It looks like any other value
> > returns Errno::EINVAL.  Not a great implementation IMHO.
> > 
> 
> Well the point is that even when I use SIGINT (either using the string 
> "SIGINT" or "INT" or the numeric value 2) it still gives the exact 
> same error.

Ah, you are correct.  That's a bug in the installer it looks like. 
Your other option is to build from source and see if you still see the
same error.

> 
> > Note that win32-process includes a nicer version of Process.kill.
> > 
> 
> I have already downloaded this and I'm playing with it.
> 
> Laurent

I don't define SIGINT or SIGKILL in win32-process, but I could easily
enough.  Also note that SIGINT probably isn't going to work they way
you think it should.  This has to do with restrictions on sending
signals to Windows processes, depenind on how those processes were
created.

However, I think I know how to make it work the way most folks would
expect.  I'll work on that in the coming weeks.

Dan