2026-04-11 Paul Eggert <eggert@cs.ucla.edu>
+ tempname: call ‘clock’ only if !CLOCK_REALTIME
+ * lib/tempname.c (random_bits) [CLOCK_REALTIME]: Do not call
+ ‘clock’, as an optimization. There is no need to call ‘clock’, as
+ it likely gives us less info than clock_gettime, and if
+ clock_gettime fails then ‘clock’ will likely fail too.
+ This patch is a simplified version of the patch made in glibc commit
+ 5f62cf88c4530c11904482775b7582bd7f6d80d2 dated 2024-09-25,
+ and Gnulib lib/tempname.c should now be suitable as-is for
+ replacing Glibc sysdeps/posix/tempname.c.
+
doc: be more like POSIX in threading terms
In documentation and comments, be more like POSIX in terminology
involving multithreading. Explain the distinction between
__clock_gettime64 (CLOCK_REALTIME, &tv);
v = mix_random_values (v, tv.tv_sec);
v = mix_random_values (v, tv.tv_nsec);
+#else
+ v = mix_random_values (v, clock ());
#endif
- *r = mix_random_values (v, clock ());
+ *r = v;
return false;
}