On Nov 13 15:25, Bruno Haible wrote:
> Corinna Vinschen wrote:
> > The rand() function would still not use locking but AFAICS that's
> > not actually required by POSIX or ISO C.
> 
> Correct. Those who want an MT-safe rand-like function need to use random(),
> not rand().

FTR, we have to differ here between plain newlib targets and Cygwin.

While Cygwin comes with it's own, table-based random() implementation
taken from BSD back in 2007, newlib's random is basically equivalent to
rand() for the sake of bare-metal and other targets with high memory
pressure.  We shouldn't change the latter since multi-threading
compliance is usually not much of a problem for that target audience.


Corinna


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

Reply via email to