Path: utzoo!utgpu!water!watmath!clyde!bellcore!decvax!decwrl!sun!imagen!atari!apratt From: apratt@atari.UUCP (Allan Pratt) Newsgroups: comp.sys.atari.st Subject: Re: C and autostarting GEM programs Message-ID: <980@atari.UUCP> Date: 16 Feb 88 22:37:08 GMT References: <4803@ihlpg.ATT.COM> Organization: Atari Corp., Sunnyvale CA Lines: 23 in article <4803@ihlpg.ATT.COM>, tainter@ihlpg.ATT.COM (Tainter) says: >> This vector gets called when you use Pterm(), too: it's not strictly a >> "control C" handler. > > This last bit makes it worthless, unless you can tell us how to tell if > we are getting a ^C or a Pterm(). > --j.a.tainter You're getting a Pterm if you call Pterm, and you're getting ^C if you don't. If you know you're calling Pterm, then call your clean-up routine on your own and un-install it before you terminate. Also un-install your terminate vector before you Pexec: you can tell what the result of the Pexec was by the return code: -32L means the child terminated with ^C. Any other LONG negative value means the Pexec failed, and any LONG positive value (i.e. (x & 0xffff0000) == 0) means it called Pterm(x). Please don't shoot words like "worthless" around unqualified. ============================================ Opinions expressed above do not necessarily -- Allan Pratt, Atari Corp. reflect those of Atari Corp. or anyone else. ...ames!atari!apratt