Path: utzoo!attcan!utgpu!jarvis.csri.toronto.edu!rutgers!att!cbnewsd!tainter From: tainter@cbnewsd.ATT.COM (johnathan.tainter) Newsgroups: comp.lang.c Subject: Re: ReadKey like Function in C Message-ID: <1330@cbnewsd.ATT.COM> Date: 23 Aug 89 19:47:37 GMT References: <1255@calvin.EE.CORNELL.EDU> Reply-To: tainter@cbnewsd.ATT.COM (johnathan.tainter,ih,) Organization: AT&T Bell Laboratories Lines: 18 In article <13653@bloom-beacon.MIT.EDU> scs@adam.pika.mit.edu (Steve Summit) writes: >I don't know why control-C's are polled under DOS; the low-level >keyboard scan codes do come in as true interrupts, so a proper, >asynchronous control-C interrupt could have been generated. The reasoning I have seen is that the BIOS is so fragile it cannot stand to have interrupts that do nontrivial things (like the DOS equivalent of tearing down a process) so they have to insure that ^C is only checked in known states of the BIOS. Thus this abomination before G*d of having it checked on i/o operations only. This might be of interrest. Of what I have seen of UNIX implementations they avoid this problem by mapping the 'hardware' interrupt into a 'software' interrupt (a signal) and checking for software interrupts when the process gets restarted after a suspend (i.e. in a known state). --johnathan.a.tainter-- att!ihlpb!tainter