Xref: utzoo comp.unix.i386:3776 comp.unix.xenix:10778 comp.unix.wizards:21192 Path: utzoo!utgpu!news-server.csri.toronto.edu!mailrus!uflorida!mephisto!gatech!galbp!samna!jeff From: jeff@samna.UUCP (jeff) Newsgroups: comp.unix.i386,comp.unix.xenix,comp.unix.wizards Subject: Re: floating point exception status not inherited by exec Message-ID: <240@samna.UUCP> Date: 26 Mar 90 21:39:45 GMT References: <795@s7.Morgan.COM> Reply-To: jeff@samna.UUCP () Followup-To: comp.unix.i386 Organization: Draughtsman's Contractors Lines: 28 In article <795@s7.Morgan.COM> amull@Morgan.COM (Andrew P. Mullhaupt) writes: >I need to preserve the state of the floating point exception mask >across an exec(). Experiments show that the exception mask and the >sticky bit status seems to be preserved across fork() (i.e. is >inherited by a child) but when exec is invoked, the exceptions may >change. This has ummm - 'unpleasant' consequences. Note that it >is not sufficient to work at the level of SIGFPE, but it is actually >required to specify the floating point exception mask and sticky bit >status to different values than the (otherwise sensible) defaults. Hmm, I'm fairly sure that the "sticky bit" ordinarily refers to the bit in the file permissions which causes an executable to hang around in the swap space even when it's not in use. I don't think anyone would want this inherited across an exec (Imagine putting the sticky bit on your shell and having it inherited across exec's - pretty soon you'd run out of swap as every single program in /bin, /usr/bin, /usr/ucb, etc. gets sucked into swap). I think you're referring to something other than the sticky bit. As for the exception mask, I think it's only fair to a process being exec'd that it know that the floating point chip is in some reasonably well-defined state when it begins execution - I'd suspect that's why it's being re-initialized. If you really need the exception mask to be set a certain way, why not pass the state to the new process as an argument and let the new process set the exception mask to the desired value. Jeff