Subject: Re: SIGFPE

From: [email-masked] (H. Peter Anvin)
Date: 19 Aug 1997 08:54:23 GMT

Followup to:  <[email-masked]>
By author:    Philip Blundell <[email-masked]>
In newsgroup: linux.dev.arm
> 
> 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.
> 

kill(getpid(), SIGFPE);

[Although you may want to do this using syscall() or assembly rather
than invoking libc.]

Throwing an FP exception for an integer divide seems strange, but
Linux/i386 seems to do the same...

	-hpa
-- 
    PGP: 2047/2A960705 BA 03 D3 2C 14 A8 A8 BD  1E DF FE 69 EE 35 BD 74
    See http://www.zytor.com/~hpa/ for web page and full PGP public key
Always looking for a few good BOsFH.  **  Linux - the OS of global cooperation
        I am Baha'i -- ask me about it or see http://www.bahai.org/