delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1996/07/17/04:15:18

Xref: news2.mv.net comp.os.msdos.djgpp:6073
From: Charles Sandmann <sandmann AT clio DOT rice DOT edu>
Newsgroups: comp.os.msdos.djgpp
Subject: Re: finding out if you are already in an exception?
Date: Wed, 10 Jul 1996 08:43:11 CDT
Organization: Rice University, Houston, Texas
Lines: 18
Message-ID: <31e3b36f.sandmann@clio.rice.edu>
References: <4rvi5r$gc AT news1 DOT goodnet DOT com>
Reply-To: sandmann AT clio DOT rice DOT edu
NNTP-Posting-Host: clio.rice.edu
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp

> I need to find out if I'm in an exception in my signal handler.  I found a
> variable in <sys/exceptn.h> called '__djgpp_exception_inprog' that is

Ah, a code turd left from the non-reentrant days.  Instead this functionality
is now determined by the pointer __djgpp_exception_state - which if it is
not NULL means an exception is in progress.

> The code below should theoretically do nothing when you hit control-c, since
> it longjmp's to the state the machine was in when you hit control-c.  If
> you hold down Control-C though, it occasionally blows up.  The only thing
> I can think of is that it's already in an exception when control-c was
> hit. Charles? :)

That's supposed to be handled (heh heh supposed...) but there might be a
bug or some window of badness I didn't think about.  When it blows up, is
is a machine wedge, a register dump, or ??  Is this under CWSDPMI or some
other DPMI?  I have shown that some other DPMIs have a problem with
reentrancy because they enable interrupts at places they aren't supposed to.

- Raw text -


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