summaryrefslogtreecommitdiff
path: root/tests/test-getrandom.c
Commit message (Collapse)AuthorAgeFilesLines
* maint: run 'make update-copyright'Simon Josefsson2023-01-011-1/+1
|
* license: fix GPLv3 texts to use a comma instead of semicolon.Bernhard Voelker2022-01-051-1/+1
| | | | | | | | | See: https://www.gnu.org/licenses/gpl-3.0.html#howto Run: $ git grep -l 'Foundation; either version 3' \ | xargs sed -i '/Foundation; either version 3/ s/n; e/n, e/' * All files using GPLv3: Adjust via the above command.
* maint: run 'make update-copyright'Paul Eggert2022-01-011-1/+1
|
* maint: run 'make update-copyright'Paul Eggert2020-12-311-1/+1
|
* getrandom-tests: do not assume GRND_RANDOM yields short readPaul Eggert2020-05-311-18/+1
| | | | | | | | | | | | * tests/test-getrandom.c (main): Omit assertion that getrandom (b, sizeof b, GRND_RANDOM | GRND_NONBLOCK) < sizeof b when b’s size is 100000. This assertion fails with Linux kernel 5.6.13, as that kernel ignores the GRND_RANDOM flag. The separate blocking pool is going away in the Linux kernel, and they’ve added a flag GRND_INSECURE instead; see: https://lore.kernel.org/linux-api/705c5a091b63cc5da70c99304bb97e0109be0a26.1577088521.git.luto@kernel.org/ The assertion was iffy anyway; what’s to prevent a kernel from lazily filling a large buffer with random bytes?
* getrandom: Doc and test tweaks.Bruno Haible2020-05-311-1/+26
| | | | | | | | | | | | * lib/getrandom.c (getrandom): Mention that it never returns 0, and that it sets errno when failing. * tests/test-getrandom.c (main): Disable the high-quality check on those platforms on which it fails. * doc/glibc-functions/getrandom.texi: Add Minix, AIX, HP-UX, IRIX, Cygwin to the list of platforms that don't have the function. Add a note about the quality of the result. * doc/glibc-headers/sys_random.texi: Don't mention the 'getrandom' declaration; this is fixed by module 'getrandom'.
* getrandom: Override incompatible system function on Solaris 11.Bruno Haible2020-05-301-1/+2
| | | | | | | | | | | | | | | | * lib/sys_random.in.h (getrandom): Override if REPLACE_GETRANDOM is 1. * lib/getrandom.c (getrandom): When the system has getrandom, just invoke it. * m4/getrandom.m4 (gl_FUNC_GETRANDOM): Set REPLACE_GETRANDOM if the system's getrandom function's prototype is not the expected one. * m4/sys_random_h.m4 (gl_SYS_RANDOM_H_DEFAULTS): Initialize REPLACE_GETRANDOM. * modules/sys_random (Makefile.am): Substitute REPLACE_GETRANDOM. * modules/getrandom (modules/getrandom): Consider REPLACE_GETRANDOM. * tests/test-getrandom.c (main): Allow error EINVAL as an alternative to EAGAIN. * doc/glibc-functions/getrandom.texi: Mention the new module and the Solaris problem.
* getrandom: Add tests.Bruno Haible2020-05-301-0/+83
* tests/test-getrandom.c: New file. * modules/getrandom-tests: New file.