delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1998/06/15/01:16:10

From: George Foot <mert0407 AT sable DOT ox DOT ac DOT uk>
Newsgroups: comp.os.msdos.djgpp
Subject: Re: Signal handlers -- what can they do?
Date: 15 Jun 1998 04:02:41 GMT
Organization: Oxford University, England
Lines: 43
Message-ID: <6m26d1$q5k$3@news.ox.ac.uk>
References: <Pine DOT SUN DOT 3 DOT 91 DOT 980614143435 DOT 6294f-100000 AT is>
NNTP-Posting-Host: sable.ox.ac.uk
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp

On Sun, 14 Jun 1998 14:45:10 +0300 (IDT) in comp.os.msdos.djgpp Eli
Zaretskii <eliz AT is DOT elta DOT co DOT il> wrote:

: On 14 Jun 1998, George Foot wrote:

: > I'm not sure what the
: > difference is between a hardware exception and a software exception.
: > As far as I understand it, the SIG* signals are all software
: > exceptions; is that right?

: In general, there is a difference, and not all signals are software
: exceptions.  But please give examples to what you call ``hardware
: exception'', as I'm not sure we are talking about the same things. 

I'm not sure what I'm talking about -- that's why I asked.  The libc
documentation for `signal' mentions hardware exceptions, and I think
it implies that SIG* are not hardware exceptions:

>  Signals are numbered 0..255 for software interrupts and 256..287 for
>  exceptions (exception number plus 256); other implementation-specific
>  codes are specified in <signal.h> (see below). Every signal is given a
>  mnemonic which you should use for portable programs.

SIG* would seem to be "other implementation-specific codes", according
to this, and they seem to start from 288; so they're not software
interrupts and they're not exceptions.

I asked because in a number of places (within that documentation, and
in the library sources) it is said that the situation is different for
these types of signal.

: In general, `_exit' should be called in all cases, since some signals, 
: like SIGSEGV, might mean a scrogged stack and other atrocities, so the 
: default handler should do as little as possible before exiting.

OK, I'll switch to using that then.

Thank you, Eli and Charles, for the information.

-- 
george DOT foot AT merton DOT oxford DOT ac DOT uk

xu do tavla fo la lojban  --  http://xiron.pc.helsinki.fi/lojban/lojban.html

- Raw text -


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