This is the mail archive of the cygwin mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

_setlocale_r


_setlocale_r isn't really reentrant, is it? It invokes loadlocale(),
which writes to the global function pointers __mbtowc and __wctomb,
i.e. there's a single global locale setting.

Its man page needs to be corrected:

       `_localeconv_r'  and  `_setlocale_r'  are  reentrant   versions   of
       `localeconv' and `setlocale' respectively.  The extra argument REENT is
       a pointer to a reentrancy structure.

(Alternatively, making them reentrant by making the locale settings
part of the REENT structure might be rather useful actually, for at
least two reasons: different threads could use different locales, and
you could convert between different charsets using the the _r versions
of the mb functions without having to switch locale all the time.)

Andy

--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]