]> Savannah Git Hosting - gnulib.git/commit
tempname: help merge with glibc
authorPaul Eggert <eggert@cs.ucla.edu>
Thu, 10 Sep 2020 06:59:18 +0000 (23:59 -0700)
committerPaul Eggert <eggert@cs.ucla.edu>
Thu, 10 Sep 2020 07:03:04 +0000 (00:03 -0700)
commit44358d4d165bcc96ceacb2c7e903053b87ab339c
tree9293c88386ec23c9d472d4a9d8ce029e656f6d68
parent976b5cb15ef4972c3700f1b151fddd4a4c6eb3ba
tempname: help merge with glibc

Inspired by draft patches by Adhemerval Zanella in:
https://sourceware.org/pipermail/libc-alpha/2020-September/117501.html
https://sourceware.org/pipermail/libc-alpha/2020-September/117502.html
* lib/tempname.c: Include stdalign.h, time.h.
If _LIBC, do not include random-bits.h.
(__getrandom, __clock_gettime64, __timespec64) [!_LIBC]: New macros.
(RANDOM_BITS): Remove, replacing with ...
(random_bits): ... this new static function.  All uses changed.
Add entropy each time if getrandom is not supported.
(RANDOM_VALUE, BASE_62_DIGITS, BASE_62_POWER):
Assume 64-bit support a la C99.
(try_tempname_len): Take advantage of ASLR when initializing
random value.
* modules/tempname (Depends-on): Add clock-time, stdalign, time.
ChangeLog
lib/tempname.c
modules/tempname