From: George Foot 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: NNTP-Posting-Host: sable.ox.ac.uk To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Precedence: bulk On Sun, 14 Jun 1998 14:45:10 +0300 (IDT) in comp.os.msdos.djgpp Eli Zaretskii 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 (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