On 8/16/22 10:47, Eli Zaretskii wrote: > (Why are you talking about MS-DOS?) I mistakenly thought it was an MS-DOS problem because tempname.c ordinarily would use clock_gettime on MinGW. I didn't know Emacs 'configure' deliberately suppresses MinGW's clock_gettime. > Thanks, but why not use 'random' instead? Emacs does have it on all > platforms, including MS-Windows. AFAIU, it's better than 'rand'. If the code used 'random' then the Gnulib 'tempname' module would need to add a dependency on the Gnulib 'random' module, which would in turn add a cascading dependency on Gnulib's 'random_r' module. It's better to avoid this dependency if we can easily do so. Come to think of it, we don't need to use 'rand' either, since tempname.c already has a good-enough pseudorandom generator. I installed into Gnulib the attached patch, which I hope fixes the Emacs problem without changing glibc's generated code (once this gets migrated back into glibc). >> If I understand things correctly this should make the names random >> enough on MS-DOS, though Emacs itself still needs a patch as I mentioned >> a few minutes ago. > > Why would Emacs need that patch? In another part of this thread you rejected that patch, on the grounds that fixing the unlikely Emacs bug is more trouble than it's worth. So I'll drop that suggestion.