www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1997/01/12/03:36:55

From: Andrew Thompson <akt AT grfn DOT org>
Newsgroups: comp.os.msdos.djgpp
Subject: Re: catching a CTRL C
Date: Sun, 12 Jan 1997 01:11:33 -0500
Organization: Grand Rapids Free-Net
Lines: 36
Message-ID: <Pine.GSO.3.95.970112010913.10176A-100000@freenet.grfn.org>
References: <5b9r78$h1f AT nntp DOT novia DOT net>
NNTP-Posting-Host: grfn.org
Mime-Version: 1.0
In-Reply-To: <5b9r78$h1f@nntp.novia.net>
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp

I think that there are two possibilites for this question.
Either, you are not including the file that #define's SIGINT or,
your compler doesn't support SIGINT, I have seen SIGBRK used.


On 12 Jan 1997, Alaric Dailey wrote:

> Ok I am working with a piece of code that will catch a ^C or ^Break
> here it is
> 
> void ctrlbrk(fptr)
> 	int (*fptr)();
> {
> 	int _signal_ (int, int (*fptr)());
> 	_signal_ (SIGINT, fptr);
> }
> 
> now the way this should work is you call this at the beginning of your
> program like so-
> 
> ctrlbrk(terminate);
> 
> where "terminate" is the function you want to run when the ^C is hit, and
> then go merrily about your program, being assured that if someone kills
> your program it will clean up after itself.  The problem is that is I
> compile it a C code I get the follwing errors -
> 
> In finction `ctrlbrk':
> `SIGINT' undeclared (first use in this function)
> 
> and if I try to use it in c++ code I get all sorts of errors
> am I over looking something or Missing the SIGINT declaration, what is
> wrong it works on one of my other compilers?
> 
> 

- Raw text -


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