#: 12116 S12/OS9/68000 (OSK)
07-Sep-91 20:02:58
Sb: #Intercepts
Fm: Bob van der Poel 76510,2203
To: all
I'd like to use an intercept to check for the user hitting the keyboard abort
key. When the key is hit my program should go and delete a bunch of temporary
files and do some other cleanup chores, then it should terminate.
The example on page 82 of the Microware C manual shows an example of this. The
interecpt routine sets a global flag which the main loop of the program
monitors. This is not workable, since I don't have a main loop which is checked
on a continuous basis--control could be in any of several areas, so checking a
flag is out. On the other hand, I can't do I/O, etc. until after I leave the
intercept . . . and simply branching to another routine IS NOT leaving the
intercept. So, what I need is a method to tell OS9 than it's okay to leave
system mode, then I'll call my cleanup routines and exit. Anyone know how I
tell this lie to the system?
BTW, I guess the same problem occurs using longjmp() if you want to restart the
program after a signal.
The fact that OS9 leaves you in system mode after a signal interecpt is a real
pain if you are writing an application. Too bad there isn't some kind of flag
which could be set when the intercept is set up to signal system or user mode.
There are 2 Replies.
|