Date: Tue, 7 May 1996 12:02:14 +0800 (GMT+0800) From: Orlando Andico To: Barry A Giffel cc: djgpp AT delorie DOT com Subject: Re: ANSI C signal definitions In-Reply-To: Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII On 7 May 1996, Barry A Giffel wrote: > Next, if SIGINT should not be defined, what's the best way to trap > this signal. When a user presses Control-C, the SIGINT signal is > generated, I need to be able to catch this signal and run a signal > handler routine before exiting. The naive solution if you're using Unix is just to set up a signal handler for the appropriate signal: void sighandler (int signal) { /* do whatever */ } and then in your main code signal (SIGINT, sighandler); at least, that should work. I'm not too sure under DJGPP because of all the glitches associated with DOS. But since v2 aims for POSIX compliance, it should support this behavior. Cheers, Orly orly AT abigail DOT eee DOT upd DOT edu DOT ph