From: Andrew Thompson 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: References: <5b9r78$h1f AT nntp DOT novia DOT net> NNTP-Posting-Host: grfn.org Mime-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII 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? > >