[comp.lang.c] MSC 4.0 interrupt handlers

creps@silver.bacs.indiana.edu (Steve Creps) (01/24/88)

   I have a program I'm porting from Unix to MS-DOS which makes use of
an interrupt handler to handle ^C's. Now that I have it running under
MS-DOS, this handler does not work. It seems to just ignore the ^C's.
If anyone could offer some advice I would appreciate it.
   The program is setting up the interrupt handler with the call
signal(SIGINT, interrupt);
   interrupt is declared as an int function of no arguments:
int interrupt();
 in the file in which the call to signal occurs.

The routine looks like this:

int interrupt()
{
	automatic = 0;   /* clears a flag. by the way, declared extern int */
	signal(SIGINT, interrupt);
}

   I also looked at the code in PC NetHack, and it does pretty much the same
thing, and I noticed that unlike the Unix version of NetHack, PC NetHack
doesn't ask you if you want to quit when you type ^C; it just prints "^C" and
messes up the screen.
   Any help would be appreciated.

-	-	-	-	-	-	-	-	-
Steve Creps on the VAX 8650 running Ultrix 2.0-1 at Indiana University.
creps@silver.bacs.indiana.edu, ...iuvax!silver!creps, creps@iubacs.bitnet
"F-14 Tomcat! There IS no substitute."