Jeffrey Walton wrote:
> > The attached program tests the MT-safety. Results: OK on all platforms,
> > except
> > ...
>
> If rand() and friends do not need to be MT-safe, then does it even need a
> test?
I wrote the test (but did not commit it into gnulib) because rand() is MT-safe
on GNU. If I
I wrote:
> Results: OK on all platforms, except
>
> FreeBSD 13.2 Expected value #7504 not found in multithreaded results. (4
> failures among 100 runs)
> macOS 12.5Expected value #31 not found in multithreaded results.
> Solaris 10Expected value #95981 not found in multithreaded results.
it's clear that the problem is that srand() has no effect on
> other thread - which is a bug since it violates ISO C 23.
>
> On Haiku, rand() is MT-safe while random() is not.
>
>
> 2023-11-10 Bruno Haible
>
> doc: Mention rand and srand limitations.
>
fe while random() is not.
2023-11-10 Bruno Haible
doc: Mention rand and srand limitations.
* doc/posix-functions/rand.texi: Mention multithread-safety problem.
* doc/posix-functions/srand.texi: Mention a Cygwin bug.
diff --git a/doc/posix-functions/rand.texi b/doc/