Path: 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 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