www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1996/05/08/03:42:33

Date: Wed, 8 May 1996 10:30:46 +0200 (IST)
From: Eli Zaretskii <eliz AT is DOT elta DOT co DOT il>
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.SUN.3.91.960508102647.17595C-100000@is>
Mime-Version: 1.0

On 7 May 1996, Barry A Giffel wrote:

> My first question is, should SIGINT be defined for ANSI or not?

Just edit your <signal.h> and move SIGINT definition to the ANSI part.

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

It should work after you move the definition and define a signal handler 
for SIGINT.  Note that if your program switches stdin to BINARY mode, ^C 
won't generat SIGINT unless you call `__djgpp_set_ctrl_c' with a non-zero 
argument.  Ctrl-Break always generates SIGINT.

- Raw text -


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