From: Dead_and_Gone Newsgroups: comp.os.msdos.djgpp Subject: Re: catching a CTRL C Date: Sun, 12 Jan 1997 01:49:32 -0600 Organization: Novia Internetworking <> 33.6kbps dialup; 402/390-2NET Lines: 43 Message-ID: References: <5b9r78$h1f AT nntp DOT novia DOT net> NNTP-Posting-Host: oasis.novia.net Mime-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII In-Reply-To: To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp On Sun, 12 Jan 1997, Andrew Thompson wrote: > 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 Ok I have tried SIGBRK, but I still have the same problem, put the following into your favorite editor #include void main(void) { while(1) puts("I am running on and on and on ...."); } after compiling it and linking it run it, then press control c and Djgpp gives you the following Exiting due to signal SIGINT Control-C Pressed at eip=00002d82 so my question I guess my question is "How do I catch SIGINT I thought the following code would do it, but I am doing something wrong, what is it??!?!?! void ctrlbrk(fptr) int (*fptr)(); { int _signal_(int, int (*fptr)()); _signal_(SIGINT,fptr); }