From: Xavier Leroy Subject: Polling for ctrl-C To: djgpp AT sun DOT soe DOT clarkson DOT edu Date: Tue, 18 Aug 92 12:30:41 MET DST Reply-To: Xavier DOT Leroy AT inria DOT fr I have ported an interactive program from Unix to the PC, using DJGPP. The program needs to trap keyboard interrupts. The Unix version just sets up a signal handler for SIGINT. As far as I know, this is not implemented by the DJGPP library. I can understand that it's pretty hard to generate an asynchronous interrupt from the DOS side, and have it execute some 386 protected-mode code. But the fact is I do not need asynchronous interrupts: for various reasons, the program I'm porting cannot be interrupted at any time, so the signal handler just sets a global flag, and the main program periodically polls this flag. It seems to me that it would not be very hard to implement this behavior in GO32: the ctrl-C and ctrl-break handlers would set a flag, and the program running in protected mode could would poll this flag, either directly, or through a software interrupt. My question is: has anybody experienced with a similar scheme? Any hint on how to implement this ctrl-C handling in GO32 is most welcome. Thanks for your help, - Xavier Leroy