Reentrancy support for multiprocessor systems

Likely, Grant
Tue Mar 18 17:25:00 GMT 2003

What about for the back end BSP?  The functions in libnosys put errno values
into the global definition of errno instead of using the macro.  Is there a
way to make the library use reentrant versions of errno for BSP calls, or do
I need to replace _write_r, _read_r, etc with my own versions.  If so, how
do I tell the library not to include the functions in libc/reent when

If DYNAMIC_REENT could become an configuration option in a future release,
that would be wonderful.  In the mean time I'll manage it as a patch.


-----Original Message-----
From: J. Johnston []
Sent: Tuesday, March 18, 2003 9:59 AM
To: Likely, Grant
Cc: ''
Subject: Re: Reentrancy support for multiprocessor systems

> Is it safe to modify the _impure_ptr pointer to be a macro that calls a
> function and returns the correct pointer?  (just like the errno macro?)
> there a better way to do this?

This is already done for you in libc/include/sys/reent.h.  If you set the
flag on while compiling newlib, then all references to _REENT will call a
function __getreent().  You will need to supply a version of this function
can figure out which thread it is running under and pass back the
reentrancy structure.

The flag currently must be set on manually and is meant to be set on in
either or libc/include/sys/config.h but it could be modified to be a
newlib configuration option.

-- Jeff J.

More information about the Newlib mailing list