Subject: Re: Signal handling for cygwin.dll
From: [email-masked] ("Mikey")

3 Apr 1997 14:50:57 -0800
Approved: [email-masked]
Distribution: cygnus
Message-ID: <[email-masked]>
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit
Original-To: "Sergey Okhapkin" <[email-masked]>
Original-Cc: "cygnus" <[email-masked]>
X-MSMail-Priority: Normal
X-Priority: 3
X-Mailer: Microsoft Internet Mail 4.70.1155
Original-Sender: [email-masked]

If You can figure out why this works, we're in business.

On my Win95 box.

I made the following changes to exceptions.cc after applying your Signal
handling patch.
this eliminated the segv.
start bash
press <CTRL> C untill your fingers get tired ;^)
start an app
press <CTRL> C once, you will get a message box popup BASH caused an
invalid page fault in module BASH.EXE at XXXX.XXX
<C>lose the message box the foreground app is dead, and the bash prompt
comes back!!!!!!!!!!!!!!!!!!

I realize that this messes up exception handling, so it is probably not a
good permanent solution.

PS. just eliminaging k++; and if(k == 13), dosen't work, it kills bash
immediatly.

if(sig == SIGINT)
  k++;

  if (k == 13)
  {
    /* We are going down - reset our inuse_p. */
    u->self->record_death();
    ExitProcess (0);
    }

  /* FIXME: The original version had code here to reinitialize the
exception
     handler under the guise of initializing thread exceptions.  It's not
     clear what this code was ever intended to do.  */

/*  debug_printf ("ctrl_c_handler: returning 1\n"); */
/*  return 1; */

debug_printf ("ctrl_c_handler: returning 0\n");
return 0;
}

----------
> From: Sergey Okhapkin <[email-masked]>
> To: 'Gnu-Win32' <[email-masked]>
> Cc: 'Geoffrey Noer' <[email-masked]>
> Subject: Signal handling for cygwin.dll
> Date: Tuesday, April 01, 1997 5:09 AM
> 
> 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".
-
For help on using this list, send a message to
"[email-masked]" with one line of text: "help".