delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1996/05/11/00:13:42

Xref: news2.mv.net comp.os.msdos.djgpp:3682
From: snarfy AT goodnet DOT com
Newsgroups: comp.os.msdos.djgpp
Subject: ___djgpp_exception_state_number?
Date: 11 May 1996 01:25:47 GMT
Organization: GoodNet
Lines: 25
Message-ID: <4n0qar$jso@news1.goodnet.com>
NNTP-Posting-Host: goodnet.com
Keywords: exception signal thread
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp

I've written (with a lot of help, thanks Malcolm) a timer routine that 
generates exceptions with an exception number "MY_EXCP_NUM" and I'm 
handling these exceptions with  signal(SIGILL, my_exception_handler).  The
problem is that I need to find out if its my exception or the 'real' exception
that generated the SIGILL.  Example:

void (*old_exception_handler)(int);
old_exception_handler = signal(SIGILL, my_exception_handler);
void my_exception_handler(int signum)
{
     if(___djgpp_exception_state_number == MY_EXCP_NUM)
        {
         do some stuff...
        }
     else
       old_exception_handler(signum);

}

I can't seem to find the variable that holds the exception number, so I'm
stuck.  It's not in `info libc.a Alphabetical'.  Thanks


Josh

- Raw text -


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