Mail Archives: djgpp/1997/01/12/07:11:25
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 <stdio.h>
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);
}
- Raw text -