www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1997/01/12/07:11:25

From: Dead_and_Gone <alaric AT oasis DOT novia DOT net>
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: <Pine.SOL.3.93.970112013936.13509A-100000@oasis.novia.net>
References: <5b9r78$h1f AT nntp DOT novia DOT net> <Pine DOT GSO DOT 3 DOT 95 DOT 970112010913 DOT 10176A-100000 AT freenet DOT grfn DOT org>
NNTP-Posting-Host: oasis.novia.net
Mime-Version: 1.0
In-Reply-To: <Pine.GSO.3.95.970112010913.10176A-100000@freenet.grfn.org>
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 <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 -


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