[PATCH] Async signal safe TLS accesses

Rich Felker dalias@aerifal.cx
Sat Nov 30 02:01:00 GMT 2013


On Thu, Nov 28, 2013 at 11:03:36PM -0200, Alexandre Oliva wrote:
> Since __signal_safe_malloc is guaranteed to return just-mmapped memory,
> and that is always zeroed out by the kernel, there's no real need for
> __signal_safe_calloc to dirty the pages scribbling over them with
> userland zeros; they're no different from kernel zeros ;-)

Is this part of the interface contract, or could __signal_safe_malloc
simply call malloc when outside of a context where malloc would be
invoked reentrantly? IMO the interface contract should be
well-defined, and I don't think calling malloc should ever be
permitted, since then using __signal_safe_free would not be possible
from a signal handler in general.

Rich



More information about the Libc-alpha mailing list