www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1996/05/07/21:15:27

Date: Tue, 7 May 1996 12:02:14 +0800 (GMT+0800)
From: Orlando Andico <orly AT abigail DOT eee DOT upd DOT edu DOT ph>
To: Barry A Giffel <barry AT rtp DOT avanticorp DOT com>
cc: djgpp AT delorie DOT com
Subject: Re: ANSI C signal definitions
In-Reply-To: <yeive85n88.fsf@baloo.rtp.avanticorp.com>
Message-ID: <Pine.LNX.3.91.960507120012.353A-100000@abigail.eee.upd.edu.ph>
MIME-Version: 1.0

On 7 May 1996, Barry A Giffel wrote:

<snip>
> 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.
<snip>

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

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019