Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 19 Sep 2008 12:40:28 -0400 (EDT)
From:      Daniel Eischen <deischen@freebsd.org>
To:        Stephen Montgomery-Smith <stephen@math.missouri.edu>
Cc:        freebsd-hackers@freebsd.org, FreeBSD Stable <freebsd-stable@freebsd.org>
Subject:   Re: Calling malloc from a signal handler
Message-ID:  <Pine.GSO.4.64.0809191237280.25035@sea.ntplx.net>
In-Reply-To: <48D3AE8D.50304@math.missouri.edu>
References:  <48D3AE8D.50304@math.missouri.edu>

next in thread | previous in thread | raw e-mail | index | archive | help
On Fri, 19 Sep 2008, Stephen Montgomery-Smith wrote:

> I notice that if you use "malloc" from within a signal handler on 
> FreeBSD-6.x, that you can potentially trigger a "recursive call" error.
>
> But this seems to have changed in FreeBSD-7.x.
>
> Is it now permissible to call "malloc" from within a signal handler in 
> FreeBSD-7.x?
>
> If so, should the man page of "sigaction(2)" be upgraded to say this?

You shouldn't call malloc() or any other function that
isn't async-signal-safe from a signal handler.  I don't
think we should say if it works or not, since it is
not portable and could change at any given time in
future versions of FreeBSD.

-- 
DE



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