summaryrefslogtreecommitdiff
path: root/m4/getrandom.m4
Commit message (Collapse)AuthorAgeFilesLines
* Resolve conflicts for functions introduced in Android API level 28.Bruno Haible2023-01-221-1/+4
| | | | | | | * m4/aligned_alloc.m4 (gl_FUNC_ALIGNED_ALLOC): Conditionally set REPLACE_ALIGNED_ALLOC. * m4/getrandom.m4 (gl_FUNC_GETRANDOM): Conditionally set REPLACE_GETRANDOM.
* getrandom: Rename LIB_GETRANDOM to GETRANDOM_LIB.Bruno Haible2023-01-071-4/+7
| | | | | | * m4/getrandom.m4: Rename LIB_GETRANDOM to GETRANDOM_LIB. All uses changed. * NEWS: Mention the change.
* Recognize functions added in future versions of Android.Bruno Haible2023-01-051-2/+8
| | | | | | | | | | | | | | | | | | | * m4/gnulib-common.m4 (gl_CHECK_FUNCS_ANDROID): New macro. * m4/aligned_alloc.m4 (gl_FUNC_ALIGNED_ALLOC): Use gl_CHECK_FUNCS_ANDROID instead of AC_CHECK_FUNCS_ONCE. * m4/freading.m4 (gl_FUNC_FREADING): Likewise. * m4/fseterr.m4 (gl_FUNC_FSETERR): Likewise. * m4/fwriting.m4 (gl_FUNC_FWRITING): Likewise. * m4/getentropy.m4 (gl_FUNC_GETENTROPY): Likewise. * m4/getlogin_r.m4 (gl_CHECK_FUNCS_ANDROID): Likewise. * m4/getrandom.m4 (gl_FUNC_GETRANDOM): Likewise. * m4/glob.m4 (gl_PREREQ_GLOB): Likewise. * m4/spawn_h.m4 (gl_HAVE_POSIX_SPAWN): Likewise. * doc/glibc-functions/getentropy.texi: Mark function as existing in Android 9.0. * doc/glibc-functions/getrandom.texi: Likewise. * doc/posix-functions/pthread_attr_getinheritsched.texi: Likewise. * doc/posix-functions/pthread_attr_setinheritsched.texi: Likewise.
* maint: run 'make update-copyright'Simon Josefsson2023-01-011-1/+1
|
* maint: run 'make update-copyright'Paul Eggert2022-01-011-1/+1
|
* maint: run 'make update-copyright'Paul Eggert2020-12-311-1/+1
|
* sys_random: Work around an uClibc bug.Bruno Haible2020-08-131-2/+3
| | | | | | | | | | | Reported by akater <nuclearspace@gmail.com> via Stefan Kangas <stefan@marxist.se> in <https://debbugs.gnu.org/cgi/bugreport.cgi?bug=42236>. * lib/sys_random.in.h: On uClibc, include <stddef.h> first. * m4/sys_random_h.m4 (gl_HEADER_SYS_RANDOM): Update comment. * m4/getrandom.m4 (gl_FUNC_GETRANDOM): Likewise. * doc/glibc-headers/sys_random.texi: Mention the uClibc bug.
* getrandom: Fix compilation error on native Windows (regression from 2020-06-28).Bruno Haible2020-07-041-2/+4
| | | | | | * lib/getrandom.c: Don't include <ntdef.h>. Instead, define NTSTATUS. * m4/getrandom.m4 (gl_FUNC_GETRANDOM): Include <windows.h> before <bcrypt.h>.
* getrandom: Fix compilation errors on older versions of mingw.Bruno Haible2020-06-281-1/+2
| | | | | | | | | | Reported by Eli Zaretskii <eliz@gnu.org> in <https://lists.gnu.org/archive/html/bug-gnulib/2020-06/msg00059.html>. * m4/getrandom.m4 (gl_FUNC_GETRANDOM): Test whether <bcrypt.h> exists. * lib/getrandom.c: If <bcrypt.h> is not available, include <ntdef.h> and define/declare BCRYPT_ALG_HANDLE, BCRYPT_USE_SYSTEM_PREFERRED_RNG, BCryptGenRandom ourselves.
* getrandom: Add support for native Windows.Bruno Haible2020-05-311-1/+29
| | | | | | | | | | | | | | | | | | | | | | | | | * lib/getrandom.c: Include <errno.h>, <windows.h>, <bcrypt.h>, <wincrypt.h>. (CRYPT_VERIFY_CONTEXT): New macro. (LoadLibrary, CryptAcquireContext): Redirect to the variant with suffix 'A'. (GetProcAddress): New macro. (BCryptGenRandomFuncType): New type. (BCryptGenRandomFunc, initialized): New variables. (initialize): New function. (getrandom): On native Windows, use <bcrypt.h> API when available, and <wincrypt.h> API as fallback. * m4/getrandom.m4 (gl_FUNC_GETRANDOM): Set LIB_GETRANDOM. * modules/getrandom (Link): New section. * modules/getentropy (Link): Likewise. * modules/getrandom-tests (Makefile.am): Link test-getrandom against $(LIB_GETRANDOM). * modules/getentropy-tests (Makefile.am): Link test-getentropy against $(LIB_GETRANDOM). * modules/sys_random-c++-tests (Makefile.am): Link test-sys_random-c++ against $(LIB_GETRANDOM). * doc/glibc-functions/getrandom.texi: Mention the native Windows support.
* sys_random: Work around macOS bug.Bruno Haible2020-05-311-2/+4
| | | | | | | | | * m4/sys_random_h.m4 (gl_HEADER_SYS_RANDOM): Include <sys/types.h> and <stdlib.h> before <sys/random.h>. * m4/getrandom.m4 (gl_FUNC_GETRANDOM): Likewise. * lib/sys_random.in.h: On macOS, include <sys/types.h> and <stdlib.h> first. * doc/glibc-headers/sys_random.texi: Mention the macOS problem.
* getrandom: Override incompatible system function on Solaris 11.Bruno Haible2020-05-301-1/+19
| | | | | | | | | | | | | | | | * 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.
* sys_random: New module.Bruno Haible2020-05-301-1/+2
| | | | | | | | | | | | | | | * lib/sys_random.in.h: Use the common idioms for overridable header files. * m4/sys_random_h.m4: New file. * m4/getrandom.m4 (gl_FUNC_GETRANDOM): Require gl_SYS_RANDOM_H_DEFAULTS. * modules/sys_random: New file. * modules/getrandom (Files): Remove lib/sys_random.in.h. (Depends-on): Add sys_random. (configure.ac): Use gl_SYS_RANDOM_MODULE_INDICATOR, not gl_UNISTD_MODULE_INDICATOR. (Makefile.am): Don't generate sys/random.h here. * doc/glibc-headers/sys_random.texi: New file. * doc/gnulib.texi: Include it.
* getentropy, getrandom: new modulesPaul Eggert2020-05-251-0/+15
* MODULES.html.sh (func_all_modules): * lib/unistd.in.h (getentropy, getrandom): * m4/unistd_h.m4 (gl_UNISTD_H, gl_UNISTD_H_DEFAULTS): * modules/unistd (unistd.h): Add support for getentropy, getrandom. * doc/glibc-functions/getentropy.texi (getentropy): * doc/glibc-functions/getrandom.texi (getrandom): These are now fixed on some platforms. * lib/getentropy.c, lib/getrandom.c, lib/sys_random.in.h: * m4/getentropy.m4, m4/getrandom.m4: * modules/getentropy, modules/getentropy-tests: * modules/getrandom, modules/getrandom-tests: * tests/test-getentropy.c, tests/test-getrandom.c: New files.