www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1999/10/07/17:58:17

Date: Thu, 7 Oct 1999 19:01:15 +0200 (IST)
From: Eli Zaretskii <eliz AT is DOT elta DOT co DOT il>
X-Sender: eliz AT is
To: Tim Bedding <tim AT polyhedra DOT com>
cc: "'djgpp AT delorie DOT com'" <djgpp AT delorie DOT com>
Subject: Re: Problems using signals
In-Reply-To: <01BF10C3.98917580@tim.polyhedra.com>
Message-ID: <Pine.SUN.3.91.991007185238.24155I-100000@is>
MIME-Version: 1.0
Reply-To: djgpp AT delorie DOT com
X-Mailing-List: djgpp AT delorie DOT com
X-Unsubscribes-To: listserv AT delorie DOT com

On Thu, 7 Oct 1999, Tim Bedding wrote:

> Due to a mistake, I ran a program containing
> a tight loop. This simple program did not explicitly define
> or call any signal functions.
> 
> I could not interrupt the program using Ctrl-C.
> 
> Is this to be expected?

Yes.  The DJGPP signal-generation doesn't work if/when the program is 
stuck in a tight loop that doesn't touch any data, and when the program 
is inside a call to any real-mode service (DOS, BIOS, etc.).

This is described in the docs (see the documentation of the library 
function `signal', under "Signal Mechanism Implementation Notes").

> Is there a way to program
> or compile in order to make sure that the program
> is always interruptable somehow?

I'm not aware of any way to do that, except avoiding tight loops that 
don't touch any data, and are infinite loops on top of that ;-)

Sorry, the DPMI spec simply doesn't leave any other safe way of 
supporting signals.

> I have read the info documentation of the signal function.

Then I don't understand how come you didn't know this is expected 
behavior.  Unless you have an old libc.info file from DJGPP v2.01, that 
is.

- Raw text -


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