Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 28 May 2003 09:16:21 -0700 (PDT)
From:      John Polstra <jdp@polstra.com>
To:        current@freebsd.org
Subject:   Re: gcc/libm floating-point bug?
Message-ID:  <200305281616.h4SGGLKI070255@strings.polstra.com>
In-Reply-To: <20030529011400.A1228@gamplex.bde.org>
References:  <200305201025.30296.jlido@goof.com> <20030527200208.L1802@gamplex.bde.org> <3ED3804B.DC65E10A@mindspring.com> <20030529011400.A1228@gamplex.bde.org>

next in thread | previous in thread | raw e-mail | index | archive | help
In article <20030529011400.A1228@gamplex.bde.org>,
Bruce Evans  <bde@zeta.org.au> wrote:
> On Tue, 27 May 2003, Terry Lambert wrote:
> 
> > BTW: signal stacks are irrelevent; technically, you are not
> > allowed to do floating point in signal handlers anyway.  8-).
> 
> Not true.  Signal handlers can do almost anything with local variables.
> The main relevant restrictions on them is that they must not access
> any static or global variables (other than write-only accesses to
> objects whose type is volatile sig_atomic_t) or call any functions
> that might make such accesses (which rules out calling most functions
> including everything in libm).

Those are the rules set forth by the C standard, but POSIX.1 demands
much more from the implementation.  There's a whole list of functions
that POSIX says must be safely callable from signal handlers.  Almost
all of the I/O calls are included.  Even fork and exec[lv]e must be
callable from signal handlers.

John
-- 
  John Polstra
  John D. Polstra & Co., Inc.                        Seattle, Washington USA
  "Two buttocks cannot avoid friction."                     -- Malawi saying



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