Interruptible calculations

Vincent Lefevre vincent at vinc17.org
Wed Apr 15 02:07:46 CEST 2009


On 2009-04-14 21:46:17 +0100, James Youngman wrote:
> On Tue, Apr 14, 2009 at 6:11 PM, Jafet <jafet.vixle at gmail.com> wrote:
> > I am writing a simple calculator that uses GMP.
> >
> > I would like it to be human-friendly and especially allow a keyboard
> > interrupt to quit a calculation and return to the prompt. However, if a
> > GMP function is executing at the moment I would want to force it to stop
> > and quit cleanly when the program gets a SIGINT.
> 
> If all you need to do is quit cleanly, just don't catch SIGINT.    A
> fatal exit is the default for SIGINT anyway.

If I understand correctly, Jafet wants to "quit a calculation and
return to the prompt", not to quit the program. So, SIGINT must be
catched (unless a subprocess is used).

-- 
Vincent Lefèvre <vincent at vinc17.org> - Web: <http://www.vinc17.org/>
100% accessible validated (X)HTML - Blog: <http://www.vinc17.org/blog/>
Work: CR INRIA - computer arithmetic / Arenaire project (LIP, ENS-Lyon)


More information about the gmp-discuss mailing list