ReadKey like Function in C

johnathan.tainter tainter at cbnewsd.ATT.COM
Thu Aug 24 05:47:37 AEST 1989


In article <13653 at bloom-beacon.MIT.EDU> scs at 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



More information about the Comp.lang.c mailing list