From owner-freebsd-current Wed Aug 26 07:09:42 1998 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id HAA04626 for freebsd-current-outgoing; Wed, 26 Aug 1998 07:09:42 -0700 (PDT) (envelope-from owner-freebsd-current@FreeBSD.ORG) Received: from gilgamesch.bik-gmbh.de (gilgamesch.bik-gmbh.de [194.233.237.91]) by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id HAA04621 for ; Wed, 26 Aug 1998 07:09:40 -0700 (PDT) (envelope-from cracauer@gilgamesch.bik-gmbh.de) Received: (from cracauer@localhost) by gilgamesch.bik-gmbh.de (8.8.8/8.7.3) id QAA22563; Wed, 26 Aug 1998 16:08:46 +0200 (MET DST) Message-ID: <19980826160845.B22184@cons.org> Date: Wed, 26 Aug 1998 16:08:45 +0200 From: Martin Cracauer To: Bruce Evans , current@FreeBSD.ORG, luoqi@watermarkgroup.com, shocking@prth.pgs.com Subject: Re: Floating Point Exceptions, signal handlers & subsequent ops References: <199808252351.JAA32306@godzilla.zeta.org.au> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Mailer: Mutt 0.93.1i In-Reply-To: <199808252351.JAA32306@godzilla.zeta.org.au>; from Bruce Evans on Wed, Aug 26, 1998 at 09:51:57AM +1000 Sender: owner-freebsd-current@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG 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 ), 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 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