www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1998/01/15/06:17:39

Date: Thu, 15 Jan 1998 13:17:22 +0200 (IST)
From: Eli Zaretskii <eliz AT is DOT elta DOT co DOT il>
To: Nate Eldredge <eldredge AT ap DOT net>
cc: Paul Derbyshire <ao950 AT FreeNet DOT Carleton DOT CA>, djgpp AT delorie DOT com
Subject: Re: Writing a SIGINT handler.
In-Reply-To: <199801150431.UAA16356@adit.ap.net>
Message-ID: <Pine.SUN.3.91.980115131657.12130O-100000@is>
MIME-Version: 1.0

On Wed, 14 Jan 1998, Nate Eldredge wrote:

> >No.  SIGINT is not a true exception, it is faked by the DJGPP keyboard 
> >handler when it sees either Ctrl-C or Ctrl-BREAK.  By the time your 
> >handler is called, you are in a safe state, so you can do anything and 
> >don't need to lock.
> This is true of all signals, right?  Including hardware-generated ones like
> SIGSEGV?

Mostly, yes.  However, when SIGSEGV comes not from your program that
just happened to dereference a null pointer, but from a real page
fault in the DPMI host which somehow got unhandled by its VM manager,
I would not risk another page fault that will be generated by your
handler being paged out at that time.  DOS is certainly non-reentrant,
and I don't generally trust even MS-Windows to handle such nested
faults gracefully.

Of course, usually you shouldn't have a reason to install a handler
that is meant to catch real exceptions which don't originate from
something your program did.

- Raw text -


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