Mail Archives: djgpp-workers/1996/10/17/21:34:02
Eli Zaretskii wrote:
>
> This is incorrect. Ctrl-Break winds up in the same signal handler as
> Ctrl-C, and therefore also causes the program to exit with the same exit
> code (unless you catch the signal, of course). It is true that these two
> keystrokes are handled differently on a PC, but the DJGPP setup and the
> signal handling machinery take care to tunnel them both into the same
> place. The only difference in their handling in the default handler is
> that Ctrl-Break causes a full stack trace to be printed, whereas Ctrl-C
> doesn't, but that's a feature designed to allow you to abort a stray
> program and know where did it go bananas.
I tested this last night and I am happy to say that you and Charles (who
emailed me privately) are right - Ctrl-Break is also handled as SIGINT.
But an odd thing happened when I was testing: if I pressed Ctrl-C, the
program exited instantly; while if I pressed Ctrl-Break, the system
would wait for another keystroke before exiting. Is this an artifact of
using the conio functions (cgets, getch) instead of stdio? As I recall,
when SIGINT is not handled, both keystrokes cause immediate
termination. FYI, it happened under both Windoze and CWSDPMI.
BTW, is the fact that a generated SIGINT terminates ALL programs in an
execution chain simultaneously unless one of them handles it a feature
or a bug? Just curious...
--
---------------------------------------------------------------------
| John M. Aldrich, aka Fighteer I | fighteer AT cs DOT com |
| Proud owner of what might one | http://www.cs.com/fighteer |
| day be a spectacular MUD... | Plan: To make Bill Gates suffer |
---------------------------------------------------------------------
- Raw text -