Date: Thu, 15 Jan 1998 13:17:22 +0200 (IST) From: Eli Zaretskii To: Nate Eldredge cc: Paul Derbyshire , djgpp AT delorie DOT com Subject: Re: Writing a SIGINT handler. In-Reply-To: <199801150431.UAA16356@adit.ap.net> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Precedence: bulk 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.