This is the mail archive of the
newlib@sources.redhat.com
mailing list for the newlib project.
_REENT_ONLY question
- From: "Artem B. Bityuckiy" <abityuckiy at yandex dot ru>
- To: newlib at sources dot redhat dot com
- Date: Thu, 27 Nov 2003 16:05:55 +0300
- Subject: _REENT_ONLY question
Hello.
Please, can anybody explain me why _REENT_ONLY macro is needed? For
what? Why some functions have on implementation and another have pair
with _r postfix, e.g. setlocale() and _setlocale_r(), etc. Several
functions have no such pair, e.g. ldiv(). And in all cases (that I've
seen) usual functions call _r pair adding _REENT argument. For example
'setlocale(category, locale)' just calls '_setlocale_r(p, category,
locale), where p is 'struct _reent'. I can only guess that this is
needed if external (not usual Newlib) "multiprocess support subsystem"
is used...
Can anybody explain this and give me some examples when "_r" pairs are
really useful/needed?
--
Best Regards,
Artem B. Bityuckiy,
St.-Petersburg, Russia.