Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 26 Aug 1998 16:08:45 +0200
From:      Martin Cracauer <cracauer@cons.org>
To:        Bruce Evans <bde@zeta.org.au>, current@FreeBSD.ORG, luoqi@watermarkgroup.com, shocking@prth.pgs.com
Subject:   Re: Floating Point Exceptions, signal handlers & subsequent ops
Message-ID:  <19980826160845.B22184@cons.org>
In-Reply-To: <199808252351.JAA32306@godzilla.zeta.org.au>; from Bruce Evans on Wed, Aug 26, 1998 at 09:51:57AM %2B1000
References:  <199808252351.JAA32306@godzilla.zeta.org.au>

next in thread | previous in thread | raw e-mail | index | archive | help
In <199808252351.JAA32306@godzilla.zeta.org.au>, Bruce Evans wrote: 
> 1) First decide if the exception is for FP or integer division by 0, by
>    looking at the trap code.  FreeBSD's support for trap codes is
>    primitive and unportable (see <machine/trap.h>), but probably good
>    enough to distinguish integer division by zero.

Ah, now I got it.

If sig == SIGFPE, then expect the trap code to be one of FPE_*_TRAP
values from machine/trap.h, *not* one of the T_* values.

Why is this, why two classes of trap codes?

[ For those who missed the discussion so far:
 The trap is the second argument to a signal handler. Define it like

 static int handler(int sig, int code, struct sigcontext *scp)
]

Martin 
-- 
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Martin Cracauer <cracauer@cons.org> http://www.cons.org/cracauer
BSD User Group Hamburg, Germany     http://www.bsdhh.org/

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-current" in the body of the message



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?19980826160845.B22184>