rickb@tekig4.UUCP (Rick Bensene) (12/28/85)
Greetings, OS-9 fans, Recently I've been doing some programming using the CoCo Version of the Microware C Compiler, specifically doing some 'user-friendly' stuff where intelligent trapping of Control-C is needed. The logical choice to trap the SIGINT signals is the library function signal(). The documentation says that you pass signal() the type of signal to be trapped, and a parameter specifying what action to be taken when the signal is detected. The 'action' is either a pointer to a procedure to execute when the signal is detected, or 0(zero) to cause default signal processing (abort job with signal code as exit status), or 1 to cause the signal to be ignored, with no action taken. Well, everything seems to work OK except when I try to use code 1 to cause given signals to be ignored. When I do this: ... ... signal(SIGINT,SIG_IGN); /* Where SIG_IGN is defined as 1 */ ... ... and the SIGINT signal comes in, the system immediatly crashes. I '#included' <signal.h>, and the whole mess compiles properly, but it just doesn't work no matter what I try. The other signal processing code (0) works fine, and I can pass a pointer to a procedure, and that works OK. Anyone out there got any ideas as to what the problem might be, and if it's a bug, any way to fix it? Of course, it IS possible to pass a pointer to a null routine to cause the signal to be 'ignored', but it's not a clean way to do it. Thanks in advance, Rick Bensene {ihnp4, decvax, allegra, cbosg, ucbvax}!tektronix!tekig4!rickb Phone: Weekdays (503) 627-3559 BBS: (503) 254-0458 300/1200 baud, 24 hours a day US Mail: Tektronix, Inc. - P.O. Box 500, Mail Stop 39-170 - Beaverton, Oregon 97077