Xref: utzoo comp.sys.ibm.pc:11155 comp.lang.c:6950 Path: utzoo!mnetor!uunet!husc6!cmcl2!nrl-cmf!ukma!gatech!purdue!i.cc.purdue.edu!j.cc.purdue.edu!pur-ee!iuvax!silver!creps From: creps@silver.bacs.indiana.edu (Steve Creps) Newsgroups: comp.sys.ibm.pc,comp.lang.c Subject: MSC 4.0 interrupt (^C) handler help needed Message-ID: <682@silver.bacs.indiana.edu> Date: 28 Jan 88 01:25:11 GMT Reply-To: creps@silver.UUCP (Steve Creps) Distribution: na Organization: Indiana University Computer Science Department Lines: 33 I'm trying to get an interrupt handler to work in MSC 4.0 that will handle ^C's at any time. The manual isn't a lot of help, giving only one example with the signal routine. I wrote a test program which is basically for(i=1;i<100000;i++) if (i % 10000 == 0) fprintf("%d",i); and it seems to work, except that it waits until it's ready to print the next number before calling the interrupt routine. However, it does seem as if it is storing the interrupt until output is done, and not just waiting until the output before it even recognizes the interrupt. My interrupt routine was something like int interrupt() { fprintf("*** int ***"); signal(SIGINT,interrupt); return; } I don't think it was a problem with declarations, since I'm following the example in the manual. Anyway, that was the program that seemed to (pretty much) work. In the actual, large program I'm working on, I have things declared the same way, but I can't get it to recognize the ^C. Actually, sometimes it will, but only if I hit ^C and/or ^ about a hundred or more times real fast. Even though output is being done quite a bit, it still doesn't seem to push (or queue, whatever) the interrupt. Actually, I don't even want it to have to wait for output to process the interrupt, but even that would be a step in the right direction. By the way, I AM initializing it with signal(SIGINT, interrupt); so that's not it. Any help on this would be greatly 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