Article View: comp.sys.amiga.tech
Article #12449Re: Trapping for control-C.
From: Sam Paolucci
Date: Mon, 01 May 1989 01:37
Date: Mon, 01 May 1989 01:37
29 lines
1802 bytes
1802 bytes
In article <6528@dayton.UUCP> joe@dayton.UUCP (Joseph P. Larson) writes: -> ->Okay. I'm tired of rebooting my Amiga every 15 or 20 minutes. I'm working ->on a program that really *needs* to call a routine called "cleanup" on ->exit. But the program doesn't work real good yet, and I end up ctrl-C-ing ->out of all my debug statements once I see what's going on. -> ->So here I am all set to add a call to the UNIX signal() function, but I ->see that the Amiga version looks a lot more like the kill() function. -> ->And Rob Peck's book doesn't explan this. Nor do I have the "exec" RKM. ->So, can I tell the Amiga to call cleanup() on ctrl-C, then ignore the ->possibility afterwards? (cleanup calls exit...) Under unix, I would ->just do: signal(SIGINT, cleanup); signal(SIGQUIT, cleanup); (or whatever ->the arg order is). I suspect this would fall under "exception processing" ->which Rob tells us he isn't going to tell us anything. -> ->If this is possible, does anyone have a code fragment I could use? As far as I know (and I might have used it in the past, but don't recall now) signal() and SIGINT are supported by both Manx and Lattice, and should work exactly for what you want to do. -- -+= SAM =+- "the best things in life are free" ARPA: paolucci@snll-arpagw.llnl.gov
Technical Details
Message-ID:
<105@snll-arpagw.UUCP>Path:
arc1-ca.pugleaf.net!utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!csd4.milw.wisc.edu!lll-winken!snll-arpagw!paolucciReferences:
<6528@dayton.UUCP>Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!csd4.milw.wisc.edu!lll-winken!snll-arpagw!paolucci From: paolucci@snll-arpagw.UUCP (Sam Paolucci) Newsgroups: comp.sys.amiga.tech Subject: Re: Trapping for control-C. Keywords: cleanup signals crashes Message-ID: <105@snll-arpagw.UUCP> Date: 1 May 89 01:37:40 GMT References: <6528@dayton.UUCP> Reply-To: paolucci@snll-arpagw.UUCP (Sam Paolucci) Organization: Sandia National Labs, Livermore, CA Lines: 29