delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/1997/04/03/14:50:57

From: jeffdb AT netzone DOT com ("Mikey")
Subject: Re: Signal handling for cygwin.dll
3 Apr 1997 14:50:57 -0800 :
Approved: cygnus DOT gnu-win32 AT cygnus DOT com
Distribution: cygnus
Message-ID: <199704031940.MAA02756.cygnus.gnu-win32@nz1.netzone.com>
Mime-Version: 1.0
Original-To: "Sergey Okhapkin" <sos AT prospect DOT com DOT ru>
Original-Cc: "cygnus" <gnu-win32 AT cygnus DOT com>
X-MSMail-Priority: Normal
X-Priority: 3
X-Mailer: Microsoft Internet Mail 4.70.1155
Original-Sender: owner-gnu-win32 AT cygnus DOT com

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 <sos AT prospect DOT com DOT ru>
> To: 'Gnu-Win32' <gnu-win32 AT cygnus DOT com>
> Cc: 'Geoffrey Noer' <noer AT cygnus DOT com>
> 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
> "gnu-win32-request AT cygnus DOT com" with one line of text: "help".
-
For help on using this list, send a message to
"gnu-win32-request AT cygnus DOT com" with one line of text: "help".

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019