Subject: Signal handling for cygwin.dll
From: [email-masked] (Sergey Okhapkin)

1 Apr 1997 07:34:15 -0800
Sender: [email-masked]
Approved: [email-masked]
Distribution: cygnus
Message-ID: <[email-masked]>
Original-To: "'Gnu-Win32'" <[email-masked]>
Original-Cc: "'Geoffrey Noer'" <[email-masked]>
Encoding: 60 TEXT, 221 UUENCODE
X-MS-Attachment: signal.diff 0 00-00-1980 00:00
Original-Sender: [email-masked]

Hi!

This patch adds interprocess signals support with (almost :-) unix 
semantics for cygwin.dll while running on Windows NT. The only supported 
signal on Windows 95 is SIGKILL, because of Win32 API call 
CreateRemoteThread() is not supported on W95, and I don't see any way to 
implement signals without this call easy... This patch also includes my 
"Ctrl-C in bash" patch. Any bug reports/improvements are welcome. To test 
this patch I've used the following simple program:

kill.c:
#include <stdio.h>
#include <stdlib.h>
#include <signal.h>

static void 
usage ();

int
main (int ac, char **av)
{
  int i=1, sig=SIGKILL;

  if (ac 
== 1)
    usage ();
  if (av[1][0] == '-') {
    sig = -atoi(av[1]);
 
   i++;
  }
  for (; i < ac; ++i)
    {
      int pid = atoi (av[i]);
 
     printf ("Killing %d with %d\n", pid, sig);
      kill(pid, sig);
 
   }
  return 0;
}

static void
usage ()
{
  fprintf (stderr, "Usage: kill 
[-SigNum] pid1 [pid2 ...]\n");
  exit (1);
}
------------------------
BTW, prototype for kill() is missed in <signal.h>...

 

--
Sergey Okhapkin
Moscow, Russia
Looking for a job.

-
For help on using this list, send a message to
"[email-masked]" with one line of text: "help".