home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #18 / NN_1992_18.iso / spool / comp / sys / atari / st / tech / 4435 < prev    next >
Encoding:
Text File  |  1992-08-15  |  1.3 KB  |  35 lines

  1. Newsgroups: comp.sys.atari.st.tech
  2. Path: sparky!uunet!Cadence.COM!cadence.com!bammi
  3. From: bammi@acae127.cadence.com (Jwahar R. Bammi)
  4. Subject: Re: Trapping ^C
  5. In-Reply-To: ilepore@nyx.cs.du.edu's message of Fri, 14 Aug 92 07:10:27 GMT
  6. Message-ID: <BAMMI.92Aug15110353@acae127.cadence.com>
  7. Sender: usenet@Cadence.COM (Usenet News)
  8. Nntp-Posting-Host: acae127
  9. Organization: Cadence Design Systems
  10. References: <1992Aug14.071027.24659@mnemosyne.cs.du.edu>
  11. Date: Mon, 3 Aug 1992 03:19:53 GMT
  12. Lines: 21
  13.  
  14. In article <1992Aug14.071027.24659@mnemosyne.cs.du.edu> ilepore@nyx.cs.du.edu (Ian Lepore) writes:
  15.  
  16. >  What's a good method of trapping a ^C from within a program and ignoring
  17. > it?  I've tried using the terminate handler (vector 0x0102) but that gets
  18. > control on *any* type of program exit (ie, even if you called exit()).  I
  19.     
  20.     depends on your env. if you can link with a decent C library,
  21. then installing our own handler using signal(SIGINT, myhandler)
  22. is probably the easiest. note that under TOS the handler will be
  23. invoked only on the next console i/o. under MiNT it will be "instantaneous".
  24.  
  25.     if not, you have to detect ^C at the console yourself. under
  26. MiNT you can install your own handler using <mintbind.h>
  27.  
  28. cheers,
  29. --
  30. --
  31. bang:   uunet!cadence!bammi            jwahar r. bammi
  32. domain: bammi@cadence.com
  33. GEnie:    J.Bammi
  34. CIS:    71515,155
  35.