delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/2000/02/20/14:49:58

Date: Sun, 20 Feb 2000 11:18:47 +0200 (IST)
From: Eli Zaretskii <eliz AT is DOT elta DOT co DOT il>
X-Sender: eliz AT is
To: Shawn Hargreaves <SHargreaves AT acclaimstudios DOT co DOT uk>
cc: djgpp AT delorie DOT com
Subject: Re: unload_datafile( ) freezes - please help :(
In-Reply-To: <F77915E7F086D31197F4009027CC81C9296A47@probe-2.as-london.acclaim.com>
Message-ID: <Pine.SUN.3.91.1000220111818.25009Z@is>
MIME-Version: 1.0
Reply-To: djgpp AT delorie DOT com
Errors-To: dj-admin AT delorie DOT com
X-Mailing-List: djgpp AT delorie DOT com
X-Unsubscribes-To: listserv AT delorie DOT com

On Fri, 18 Feb 2000, Shawn Hargreaves wrote:

> The Allegro handler doesn't kill the program in response to ctrl+c
> (that wouldn't be desirable for a majority of game/graphics type
> applications), but it does have an emergency exit combo, ctrl+alt+del
> or ctrl+alt+end, which is mapped onto the same thing (calls
> __djgpp_hw_exception with %al = 0x79), which causes libc to print
> the message about ctrl+c being pressed.

It would be better to simulate Ctrl-BREAK, not Ctrl-C, at least for
one of the two combinations.  The ability to generate a full traceback
is a valuable feature.

> I presume this would be hooked in the same way as calling
> the ctrl+c handler, just with a different code?

Yes, the code is (surprise!) 0x1b, the number of the interrupt
generated by Ctrl-BREAK.  See src/libc/go32/dpmiexcp.c in the library
sources.

You could also use 0x7a, which will trigger SIGQUIT, but you'd need to
enable SIGQUIT first, since it is disabled by default.  See the docs
of the function `__djgpp_traceback_exit', for the gory details.

As yet another alternative, you could simply call `abort', which will
also print a traceback.

- Raw text -


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