Subject: SIGFPE

From: Philip Blundell <[email-masked]>
Date: Sat, 26 Jul 1997 17:46:44 +0100

Is there any support in the kernel for trapping floating point exceptions 
(divide by zero and so on) and delivering a SIGFPE to the offending process?  
I don't see it in traps.c, but maybe I'm looking in the wrong place...

---

From: [email-masked]
Date: Sat, 26 Jul 1997 20:20:21 +0100 (BST)

> I don't see it in traps.c, but maybe I'm looking in the wrong place...

Why would it be in traps.c?  It is actually in the FPE since that's the logical
place for it to be (since it's just a call to the send_sig function, or more
specifically, it's module alias fp_send_sig.

I have specifically aliased a load of kernel functions to specific names for
the FPE (since I want to be in complete control of the FPE interface).  These
names are unversioned as well.

The FPE will deliver SIGFPE whenever an enabled exception is triggered.  Please
see RiscOS 3 PRM V4 for more information about the exceptions and enabling them.
   _____
  |_____| ------------------------------------------------- ---+---+-
  |   |       Russell King      [email-masked]         --- ---
  | | | | http://whirligig.ecs.soton.ac.uk/~rmk92/home.html  /  /  |
  | +-+-+                                                     --- -+-
  /   |               THE developer of ARM Linux              |+| /|\
 /  | | |      *  who wishes that he was in Hong Kong  *      ---  |
    +-+-+ -------------------------------------------------  /\\\  |

---

From: Philip Blundell <[email-masked]>
Date: Sat, 26 Jul 1997 23:31:59 +0100

>Why would it be in traps.c?  It is actually in the FPE since that's the
>logical place for it to be (since it's just a call to the send_sig function,
>or more specifically, it's module alias fp_send_sig.

I was looking for a way to throw floating point exceptions from user code - 
specifically libgcc1, which needs some way to raise an error when you try an 
integer divide by zero.

p.

---

From: Alan Cox <[email-masked]>
Date: Mon, 28 Jul 1997 10:04:07 +0100 (BST)

> specifically libgcc1, which needs some way to raise an error when you try an 

ANSI C - "raise(signal)"