From owner-freebsd-hackers Mon Nov 4 22:33:23 1996 Return-Path: owner-hackers Received: (from root@localhost) by freefall.freebsd.org (8.7.5/8.7.3) id WAA08983 for hackers-outgoing; Mon, 4 Nov 1996 22:33:23 -0800 (PST) Received: from godzilla.zeta.org.au (godzilla.zeta.org.au [203.2.228.19]) by freefall.freebsd.org (8.7.5/8.7.3) with ESMTP id WAA08955 for ; Mon, 4 Nov 1996 22:33:05 -0800 (PST) Received: (from bde@localhost) by godzilla.zeta.org.au (8.7.6/8.6.9) id RAA16574; Tue, 5 Nov 1996 17:29:48 +1100 Date: Tue, 5 Nov 1996 17:29:48 +1100 From: Bruce Evans Message-Id: <199611050629.RAA16574@godzilla.zeta.org.au> To: hasty@rah.star-gate.com, mtaylor@cybernet.com Subject: RE: Geomview, Mbone and FreeBSD... Cc: hackers@FreeBSD.org Sender: owner-hackers@FreeBSD.org X-Loop: FreeBSD.org Precedence: bulk >Already done. I've submitted the patches to the Geometry Center. They >were developed with the help of one of their workers. >... >diff -c -r Geomview.orig/src/bin/geomview/x11/gvmain.c Geomview/src/bin/geomview >/x11/gvmain.c >*** Geomview.orig/src/bin/geomview/x11/gvmain.c Thu Nov 17 18:45:03 1994 >--- Geomview/src/bin/geomview/x11/gvmain.c Wed Jul 24 16:19:58 1996 >*************** >*** 10,18 **** > #ifdef __linux__ > #include > #endif >! #ifdef __osf__ > #include > #endif > > /* xgv main - global variables */ > /***************************************************************************** >/ >--- 10,21 ---- > #ifdef __linux__ > #include > #endif >! #if defined(__osf__) || defined(__FreeBSD__) > #include > #endif >+ #ifdef __FreeBSD__ >+ #include >+ #endif > > /* xgv main - global variables */ > /***************************************************************************** >/ >*************** >*** 40,46 **** > __setfpucw(_FPU_IEEE); > #endif > >! #ifdef __osf__ > signal(SIGFPE, SIG_IGN); /* Ignore e.g. divide-by-zero traps */ > #endif > >--- 43,53 ---- > __setfpucw(_FPU_IEEE); > #endif > >! #ifdef __FreeBSD__ >! fpsetmask(fpgetmask()&(~FP_X_DZ)); >! #endif >! >! #if defined(__osf__) || defined(__FreeBSD__) > signal(SIGFPE, SIG_IGN); /* Ignore e.g. divide-by-zero traps */ > #endif The fpsetmask() call should probably mask all floating point exceptions like the __setfpucw() call apparently does. The signal stuff would then be unnecessary. It is broken anyway. Masking SIGFPE is rarely correct and is never correct for FreeBSD on i386's since it causes the following behaviour: - if the signal is for integer division by zero, then the faulting division is restarted endlessly. - if the signal is for a floating point exception, then the result will usually be wrong and the stack will usually pile up. E.g., for 1/+0, where 1 is in %st(0) and +0 is in %st(1), the operands will be left on the stack and the result will be 1 (sort of) and +0 will remain as junk on the stack. >diff -c -r Geomview.orig/src/lib/oogl/refcomm/streampool.c Geomview/src/lib/oogl >/refcomm/streampool.c >*** Geomview.orig/src/lib/oogl/refcomm/streampool.c Sun Oct 16 19:11:55 1994 >--- Geomview/src/lib/oogl/refcomm/streampool.c Thu Jul 11 22:39:50 1996 >*************** >*** 218,227 **** >--- 218,235 ---- > p->otype = PO_ALL; > p->next = NULL; > p->mode = rw; >+ #ifndef __FreeBSD__ > p->seekable = (p->inf && tell(fileno(p->inf)) != -1 && >+ #else >+ p->seekable = (p->inf && ftell(p->inf) != -1 && >+ #endif ftell() is ANSI standard, while tell() is nonstandard, so the "__FreeBSD__" case should be the normal case. Bruce