Mail Archives: cygwin-developers/1998/03/22/14:07:45
Hi all,
Anyone have any suggestions?
A developer here reported:
> I'm am working on getting command-line GDB working under NT, and
> have run into a real show-stopper. It seems that programs that
> attempt to longjmp out of
> signal handlers simply exit. The following program illustrates the problem.
> Just run it, and type ^C. You can see the signal handler being invoked, and
> then the return from sigsetjmp, however the program exits a moment
> later!
[...]
> #include <signal.h>
> #include <stdio.h>
> #include <setjmp.h>
>
> sigjmp_buf jb;
>
> static void
> sigint_handler (int foo)
> {
> printf ("SIGINT handler\n");
>
> siglongjmp (jb, 1);
> }
>
> main ()
> {
> printf ("hello world\n");
>
> signal (SIGINT, sigint_handler);
>
> if (sigsetjmp (jb, 1) == 0)
> printf ("sigsetjmp == 0\n");
> else
> printf ("sigsetjmp == 1\n");
>
> while (1);
> }
>
--
Geoffrey Noer
noer AT cygnus DOT com
- Raw text -