home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #18 / NN_1992_18.iso / spool / comp / unix / bsd / 4461 < prev    next >
Encoding:
Internet Message Format  |  1992-08-19  |  798 b 

  1. Path: sparky!uunet!kithrup!hoptoad!decwrl!mips!swrinde!zaphod.mps.ohio-state.edu!rpi!newsserver.pixel.kodak.com!laidbak!tellab5!vpnet!serveme!tallboy!news
  2. From: dj@ctron.com (DJ Delorie)
  3. Newsgroups: comp.unix.bsd
  4. Subject: Polling for ctrl-C
  5. Message-ID: <9208181316.AA23698@athena.ctron>
  6. Date: 18 Aug 92 13:16:10 GMT
  7. Sender: news@tallboy.chi.il.us
  8. Lines: 10
  9.  
  10. >But the fact is I do not need asynchronous interrupts: for various
  11. >reasons, the program I'm porting cannot be interrupted at any time, so
  12. >the signal handler just sets a global flag, and the main program
  13. >periodically polls this flag.
  14.  
  15. You could just shut off ctrl-c handling completely, and look for the
  16. ^C character when you scan the keyboard (kbhit() and getch()).  1.08
  17. will have setcbrk(), but 1.07 has int 0x21 AH=0x33 already.
  18.  
  19. DJ
  20.