Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!tut.cis.ohio-state.edu!ukma!rutgers!dayton!joe From: joe@dayton.UUCP (Joseph P. Larson) Newsgroups: comp.sys.amiga.tech Subject: Trapping for control-C. Keywords: cleanup signals crashes Message-ID: <6528@dayton.UUCP> Date: 30 Apr 89 19:23:23 GMT Reply-To: joe@dayton.UUCP (Joseph P. Larson) Organization: Dayton-Hudson Dept. Store Co. Lines: 23 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? -Joe -- Life is a cabaret (old chum). UUCP: rutgers!dayton!joe (Picts 1-13 are DHDSC - Joe Larson/MIS 1060 ATT : (612) 375-3537 now ready.) 700 on the Mall, Mpls, Mn. 55402