Non reentrant floating point functions?

Eric Blake
Fri Mar 13 12:24:00 GMT 2015

On 03/13/2015 03:29 AM, Rasmus Bo Sørensen wrote:
> Hi,
> I just started using the floating point functions of newlib on an
> embedded multicore processor that we are developing at the Technical University of Denmark.
> I am puzzled about the "#ifndef _REENT_ONLY"  in line 125 of 'newlib/libc/include/math.h'.
> Are the functions in lines 127 - 138 not meant to be reentrant?
> And in this case what is it that makes them non-reentrant?

Any math function which is required to set errno on failure is not
necessarily reentrant (or rather, _REENT_ONLY is designed to protect
setups where errno is global rather than thread-local).

Eric Blake   eblake redhat com    +1-919-301-3266
Libvirt virtualization library

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 604 bytes
Desc: OpenPGP digital signature
URL: <>

More information about the Newlib mailing list