summaryrefslogtreecommitdiff
path: root/m4
diff options
context:
space:
mode:
authorPaul Eggert <eggert@cs.ucla.edu>2020-06-27 10:00:17 -0700
committerPaul Eggert <eggert@cs.ucla.edu>2020-06-27 10:07:12 -0700
commit118c07e02e939c9f52688091509d4bff2a897032 (patch)
treefc04265957e147b8634091d34da5c0e80b88b8df /m4
parentffb89ed5f07491e33fc79d8b4be49d9deba2ad4a (diff)
downloademacs-118c07e02e939c9f52688091509d4bff2a897032.tar.gz
Update from Gnulib
This incorporates: 2020-06-27 getloadavg: don’t depend on fopen-gnu 2020-06-25 c-dtoastr, c-ldtoastr: new modules 2020-06-01 getloadavg: fix double-increment bug 2020-06-01 tempname: use getrandom, not getentropy 2020-05-31 tempname: merge from glibc and coreutils 2020-05-31 getentropy: work around a macOS and Solaris problem 2020-05-31 fnmatch: merge from glibc 2020-05-30 unistd: remove conflicting declaration of getrandom 2020-05-30 don't assume that UNICODE is not defined 2020-05-29 fix compilation error on native Windows 2020-05-28 avoid dynamic loading of Windows API functions when possible 2020-05-28 at-internal: make more robust in multithreaded applications 2020-05-28 getloadavg: make more robust in multithreaded applications 2020-05-27 getloadavg: make more robust in multithreaded applications 2020-05-26 count-one-bits: fix MSVC specific code 2020-05-25 getentropy, getrandom: new modules 2020-05-24 open, openat: really support O_CLOEXEC 2020-05-23 verify: document ‘assume’ better 2020-05-21 regex: configure better with "clang -fsanitize=leak" 2020-05-21 memmem: configure better with "clang -fsanitize=undefined" 2020-05-19 ftoastr: fix ifndef typo * build-aux/config.guess, build-aux/config.sub, doc/misc/texinfo.tex: * lib/count-one-bits.h, lib/ftoastr.c, lib/ftoastr.h: * lib/getloadavg.c, lib/gettimeofday.c, lib/libc-config.h: * lib/open.c, lib/openat-proc.c, lib/tempname.c, lib/tempname.h: * lib/unistd.in.h, lib/verify.h, m4/memmem.m4, m4/regex.m4: * m4/unistd_h.m4: Update from Gnulib. * lib/getrandom.c, lib/sys_random.in.h: * m4/getrandom.m4, m4/sys_random_h.m4: New files, copied from Gnulib. * lib/gnulib.mk.in, m4/gnulib-comp.m4: Regenerate.
Diffstat (limited to 'm4')
-rw-r--r--m4/getrandom.m464
-rw-r--r--m4/gnulib-comp.m455
-rw-r--r--m4/memmem.m44
-rw-r--r--m4/regex.m492
-rw-r--r--m4/sys_random_h.m452
-rw-r--r--m4/unistd_h.m47
6 files changed, 217 insertions, 57 deletions
diff --git a/m4/getrandom.m4 b/m4/getrandom.m4
new file mode 100644
index 00000000000..37fb10023a0
--- /dev/null
+++ b/m4/getrandom.m4
@@ -0,0 +1,64 @@
+# getrandom.m4 serial 5
+dnl Copyright 2020 Free Software Foundation, Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+
+dnl Written by Paul Eggert.
+
+AC_DEFUN([gl_FUNC_GETRANDOM],
+[
+ AC_REQUIRE([gl_SYS_RANDOM_H_DEFAULTS])
+ AC_CHECK_FUNCS_ONCE([getrandom])
+ if test "$ac_cv_func_getrandom" != yes; then
+ HAVE_GETRANDOM=0
+ else
+ dnl On Solaris 11.4 the return type is 'int', not 'ssize_t'.
+ AC_CACHE_CHECK([whether getrandom is compatible with its GNU+BSD signature],
+ [gl_cv_func_getrandom_ok],
+ [AC_COMPILE_IFELSE(
+ [AC_LANG_PROGRAM(
+ [[/* Additional includes are needed before <sys/random.h> on Mac OS X. */
+ #include <sys/types.h>
+ #include <stdlib.h>
+ #include <sys/random.h>
+ ssize_t getrandom (void *, size_t, unsigned int);
+ ]],
+ [[]])
+ ],
+ [gl_cv_func_getrandom_ok=yes],
+ [gl_cv_func_getrandom_ok=no])
+ ])
+ if test $gl_cv_func_getrandom_ok = no; then
+ REPLACE_GETRANDOM=1
+ fi
+ fi
+
+ case "$host_os" in
+ mingw*)
+ AC_CACHE_CHECK([whether the bcrypt library is guaranteed to be present],
+ [gl_cv_lib_assume_bcrypt],
+ [AC_COMPILE_IFELSE(
+ [AC_LANG_PROGRAM(
+ [[#include <windows.h>]],
+ [[#if !(_WIN32_WINNT >= _WIN32_WINNT_WIN7)
+ cannot assume it
+ #endif
+ ]])
+ ],
+ [gl_cv_lib_assume_bcrypt=yes],
+ [gl_cv_lib_assume_bcrypt=no])
+ ])
+ if test $gl_cv_lib_assume_bcrypt = yes; then
+ AC_DEFINE([HAVE_LIB_BCRYPT], [1],
+ [Define to 1 if the bcrypt library is guaranteed to be present.])
+ LIB_GETRANDOM='-lbcrypt'
+ else
+ LIB_GETRANDOM='-ladvapi32'
+ fi
+ ;;
+ *)
+ LIB_GETRANDOM= ;;
+ esac
+ AC_SUBST([LIB_GETRANDOM])
+])
diff --git a/m4/gnulib-comp.m4 b/m4/gnulib-comp.m4
index 37170247884..1dc50a4a95c 100644
--- a/m4/gnulib-comp.m4
+++ b/m4/gnulib-comp.m4
@@ -53,6 +53,7 @@ AC_DEFUN([gl_EARLY],
# Code from module byteswap:
# Code from module c-ctype:
# Code from module c-strcase:
+ # Code from module c99:
# Code from module canonicalize-lgpl:
# Code from module careadlinkat:
# Code from module clock-time:
@@ -102,6 +103,7 @@ AC_DEFUN([gl_EARLY],
# Code from module getloadavg:
# Code from module getopt-gnu:
# Code from module getopt-posix:
+ # Code from module getrandom:
# Code from module gettext-h:
# Code from module gettime:
# Code from module gettimeofday:
@@ -163,6 +165,7 @@ AC_DEFUN([gl_EARLY],
# Code from module strtoimax:
# Code from module strtoll:
# Code from module symlink:
+ # Code from module sys_random:
# Code from module sys_select:
# Code from module sys_stat:
# Code from module sys_time:
@@ -324,6 +327,11 @@ AC_DEFUN([gl_INIT],
fi
AC_SUBST([GNULIB_GL_UNISTD_H_GETOPT])
gl_UNISTD_MODULE_INDICATOR([getopt-posix])
+ gl_FUNC_GETRANDOM
+ if test $HAVE_GETRANDOM = 0 || test $REPLACE_GETRANDOM = 1; then
+ AC_LIBOBJ([getrandom])
+ fi
+ gl_SYS_RANDOM_MODULE_INDICATOR([getrandom])
gl_GETTIME
gl_FUNC_GETTIMEOFDAY
if test $HAVE_GETTIMEOFDAY = 0 || test $REPLACE_GETTIMEOFDAY = 1; then
@@ -334,6 +342,7 @@ AC_DEFUN([gl_INIT],
gl_IEEE754_H
gl_INTTYPES_INCOMPLETE
AC_REQUIRE([gl_LARGEFILE])
+ gl___INLINE
gl_LIMITS_H
gl_FUNC_LSTAT
if test $REPLACE_LSTAT = 1; then
@@ -374,6 +383,12 @@ AC_DEFUN([gl_INIT],
gl_TIME_MODULE_INDICATOR([mktime])
gl_MULTIARCH
gl_FUNC_GNU_STRFTIME
+ gl_FUNC_OPEN
+ if test $REPLACE_OPEN = 1; then
+ AC_LIBOBJ([open])
+ gl_PREREQ_OPEN
+ fi
+ gl_FCNTL_MODULE_INDICATOR([open])
gl_PATHMAX
gl_FUNC_PIPE2
gl_UNISTD_MODULE_INDICATOR([pipe2])
@@ -443,6 +458,8 @@ AC_DEFUN([gl_INIT],
AC_LIBOBJ([symlink])
fi
gl_UNISTD_MODULE_INDICATOR([symlink])
+ gl_HEADER_SYS_RANDOM
+ AC_PROG_MKDIR_P
AC_REQUIRE([gl_HEADER_SYS_SELECT])
AC_PROG_MKDIR_P
gl_HEADER_SYS_STAT_H
@@ -489,11 +506,9 @@ AC_DEFUN([gl_INIT],
gl_gnulib_enabled_be453cec5eecf5731a274f2de7f2db36=false
gl_gnulib_enabled_a9786850e999ae65a836a6041e8e5ed1=false
gl_gnulib_enabled_lchmod=false
- gl_gnulib_enabled_21ee726a3540c09237a8e70c0baf7467=false
gl_gnulib_enabled_2049e887c7e5308faad27b3f894bb8c9=false
gl_gnulib_enabled_malloca=false
gl_gnulib_enabled_5264294aa0a5557541b53c8c741f7f31=false
- gl_gnulib_enabled_open=false
gl_gnulib_enabled_03e0aaad4cb89ca757653bd367a6ccb7=false
gl_gnulib_enabled_6099e9737f757db36c47fa9d9f02e88c=false
gl_gnulib_enabled_strtoll=false
@@ -503,7 +518,6 @@ AC_DEFUN([gl_INIT],
{
if ! $gl_gnulib_enabled_260941c0e5dc67ec9e87d1fb321c300b; then
gl_gnulib_enabled_260941c0e5dc67ec9e87d1fb321c300b=true
- func_gl_gnulib_m4code_open
fi
}
func_gl_gnulib_m4code_cloexec ()
@@ -603,13 +617,6 @@ AC_DEFUN([gl_INIT],
gl_gnulib_enabled_lchmod=true
fi
}
- func_gl_gnulib_m4code_21ee726a3540c09237a8e70c0baf7467 ()
- {
- if ! $gl_gnulib_enabled_21ee726a3540c09237a8e70c0baf7467; then
- gl___INLINE
- gl_gnulib_enabled_21ee726a3540c09237a8e70c0baf7467=true
- fi
- }
func_gl_gnulib_m4code_2049e887c7e5308faad27b3f894bb8c9 ()
{
if ! $gl_gnulib_enabled_2049e887c7e5308faad27b3f894bb8c9; then
@@ -637,21 +644,6 @@ AC_DEFUN([gl_INIT],
gl_gnulib_enabled_5264294aa0a5557541b53c8c741f7f31=true
fi
}
- func_gl_gnulib_m4code_open ()
- {
- if ! $gl_gnulib_enabled_open; then
- gl_FUNC_OPEN
- if test $REPLACE_OPEN = 1; then
- AC_LIBOBJ([open])
- gl_PREREQ_OPEN
- fi
- gl_FCNTL_MODULE_INDICATOR([open])
- gl_gnulib_enabled_open=true
- if test $REPLACE_OPEN = 1; then
- func_gl_gnulib_m4code_cloexec
- fi
- fi
- }
func_gl_gnulib_m4code_03e0aaad4cb89ca757653bd367a6ccb7 ()
{
if ! $gl_gnulib_enabled_03e0aaad4cb89ca757653bd367a6ccb7; then
@@ -734,8 +726,8 @@ AC_DEFUN([gl_INIT],
if test $NEED_LOCALTIME_BUFFER = 1; then
func_gl_gnulib_m4code_2049e887c7e5308faad27b3f894bb8c9
fi
- if test $REPLACE_MKTIME = 1; then
- func_gl_gnulib_m4code_21ee726a3540c09237a8e70c0baf7467
+ if test $REPLACE_OPEN = 1; then
+ func_gl_gnulib_m4code_cloexec
fi
if test $HAVE_READLINKAT = 0; then
func_gl_gnulib_m4code_260941c0e5dc67ec9e87d1fb321c300b
@@ -743,9 +735,6 @@ AC_DEFUN([gl_INIT],
if test $HAVE_READLINKAT = 0; then
func_gl_gnulib_m4code_03e0aaad4cb89ca757653bd367a6ccb7
fi
- if test $ac_use_included_regex = yes; then
- func_gl_gnulib_m4code_21ee726a3540c09237a8e70c0baf7467
- fi
if { test $HAVE_DECL_STRTOIMAX = 0 || test $REPLACE_STRTOIMAX = 1; } && test $ac_cv_type_long_long_int = yes; then
func_gl_gnulib_m4code_strtoll
fi
@@ -771,11 +760,9 @@ AC_DEFUN([gl_INIT],
AM_CONDITIONAL([gl_GNULIB_ENABLED_be453cec5eecf5731a274f2de7f2db36], [$gl_gnulib_enabled_be453cec5eecf5731a274f2de7f2db36])
AM_CONDITIONAL([gl_GNULIB_ENABLED_a9786850e999ae65a836a6041e8e5ed1], [$gl_gnulib_enabled_a9786850e999ae65a836a6041e8e5ed1])
AM_CONDITIONAL([gl_GNULIB_ENABLED_lchmod], [$gl_gnulib_enabled_lchmod])
- AM_CONDITIONAL([gl_GNULIB_ENABLED_21ee726a3540c09237a8e70c0baf7467], [$gl_gnulib_enabled_21ee726a3540c09237a8e70c0baf7467])
AM_CONDITIONAL([gl_GNULIB_ENABLED_2049e887c7e5308faad27b3f894bb8c9], [$gl_gnulib_enabled_2049e887c7e5308faad27b3f894bb8c9])
AM_CONDITIONAL([gl_GNULIB_ENABLED_malloca], [$gl_gnulib_enabled_malloca])
AM_CONDITIONAL([gl_GNULIB_ENABLED_5264294aa0a5557541b53c8c741f7f31], [$gl_gnulib_enabled_5264294aa0a5557541b53c8c741f7f31])
- AM_CONDITIONAL([gl_GNULIB_ENABLED_open], [$gl_gnulib_enabled_open])
AM_CONDITIONAL([gl_GNULIB_ENABLED_03e0aaad4cb89ca757653bd367a6ccb7], [$gl_gnulib_enabled_03e0aaad4cb89ca757653bd367a6ccb7])
AM_CONDITIONAL([gl_GNULIB_ENABLED_6099e9737f757db36c47fa9d9f02e88c], [$gl_gnulib_enabled_6099e9737f757db36c47fa9d9f02e88c])
AM_CONDITIONAL([gl_GNULIB_ENABLED_strtoll], [$gl_gnulib_enabled_strtoll])
@@ -1004,6 +991,7 @@ AC_DEFUN([gl_FILE_LIST], [
lib/getopt.in.h
lib/getopt1.c
lib/getopt_int.h
+ lib/getrandom.c
lib/gettext.h
lib/gettime.c
lib/gettimeofday.c
@@ -1076,6 +1064,7 @@ AC_DEFUN([gl_FILE_LIST], [
lib/strtol.c
lib/strtoll.c
lib/symlink.c
+ lib/sys_random.in.h
lib/sys_select.in.h
lib/sys_stat.in.h
lib/sys_time.in.h
@@ -1144,6 +1133,7 @@ AC_DEFUN([gl_FILE_LIST], [
m4/getgroups.m4
m4/getloadavg.m4
m4/getopt.m4
+ m4/getrandom.m4
m4/gettime.m4
m4/gettimeofday.m4
m4/gl-openssl.m4
@@ -1205,6 +1195,7 @@ AC_DEFUN([gl_FILE_LIST], [
m4/strtoimax.m4
m4/strtoll.m4
m4/symlink.m4
+ m4/sys_random_h.m4
m4/sys_select_h.m4
m4/sys_socket_h.m4
m4/sys_stat_h.m4
diff --git a/m4/memmem.m4 b/m4/memmem.m4
index e034d7bd775..35a5bb19d1a 100644
--- a/m4/memmem.m4
+++ b/m4/memmem.m4
@@ -1,4 +1,4 @@
-# memmem.m4 serial 26
+# memmem.m4 serial 27
dnl Copyright (C) 2002-2004, 2007-2020 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
@@ -37,7 +37,7 @@ AC_DEFUN([gl_FUNC_MEMMEM_SIMPLE],
/* Check for empty needle behavior. */
{
const char *haystack = "AAA";
- if (memmem (haystack, 3, NULL, 0) != haystack)
+ if (memmem (haystack, 3, (const char *) 1, 0) != haystack)
result |= 2;
}
return result;
diff --git a/m4/regex.m4 b/m4/regex.m4
index 65f518582c1..e723f591216 100644
--- a/m4/regex.m4
+++ b/m4/regex.m4
@@ -1,4 +1,4 @@
-# serial 69
+# serial 70
# Copyright (C) 1996-2001, 2003-2020 Free Software Foundation, Inc.
#
@@ -90,11 +90,14 @@ AC_DEFUN([gl_REGEX],
s = re_compile_pattern (pat, sizeof pat - 1, &regex);
if (s)
result |= 1;
- else if (re_search (&regex, data, sizeof data - 1,
- 0, sizeof data - 1, &regs)
- != -1)
- result |= 1;
- regfree (&regex);
+ else
+ {
+ if (re_search (&regex, data, sizeof data - 1,
+ 0, sizeof data - 1, &regs)
+ != -1)
+ result |= 1;
+ regfree (&regex);
+ }
}
{
@@ -125,8 +128,8 @@ AC_DEFUN([gl_REGEX],
0, sizeof data - 1, 0);
if (i != 0 && i != 21)
result |= 1;
+ regfree (&regex);
}
- regfree (&regex);
}
if (! setlocale (LC_ALL, "C"))
@@ -139,9 +142,13 @@ AC_DEFUN([gl_REGEX],
s = re_compile_pattern ("a[^x]b", 6, &regex);
if (s)
result |= 2;
- /* This should fail, but succeeds for glibc-2.5. */
- else if (re_search (&regex, "a\nb", 3, 0, 3, &regs) != -1)
- result |= 2;
+ else
+ {
+ /* This should fail, but succeeds for glibc-2.5. */
+ if (re_search (&regex, "a\nb", 3, 0, 3, &regs) != -1)
+ result |= 2;
+ regfree (&regex);
+ }
/* This regular expression is from Spencer ere test number 75
in grep-2.3. */
@@ -153,7 +160,10 @@ AC_DEFUN([gl_REGEX],
s = re_compile_pattern ("a[[:@:>@:]]b\n", 11, &regex);
/* This should fail with _Invalid character class name_ error. */
if (!s)
- result |= 4;
+ {
+ result |= 4;
+ regfree (&regex);
+ }
/* Ensure that [b-a] is diagnosed as invalid, when
using RE_NO_EMPTY_RANGES. */
@@ -161,13 +171,18 @@ AC_DEFUN([gl_REGEX],
memset (&regex, 0, sizeof regex);
s = re_compile_pattern ("a[b-a]", 6, &regex);
if (s == 0)
- result |= 8;
+ {
+ result |= 8;
+ regfree (&regex);
+ }
/* This should succeed, but does not for glibc-2.1.3. */
memset (&regex, 0, sizeof regex);
s = re_compile_pattern ("{1", 2, &regex);
if (s)
result |= 8;
+ else
+ regfree (&regex);
/* The following example is derived from a problem report
against gawk from Jorge Stolfi <stolfi@ic.unicamp.br>. */
@@ -175,17 +190,35 @@ AC_DEFUN([gl_REGEX],
s = re_compile_pattern ("[an\371]*n", 7, &regex);
if (s)
result |= 8;
- /* This should match, but does not for glibc-2.2.1. */
- else if (re_match (&regex, "an", 2, 0, &regs) != 2)
- result |= 8;
+ else
+ {
+ /* This should match, but does not for glibc-2.2.1. */
+ if (re_match (&regex, "an", 2, 0, &regs) != 2)
+ result |= 8;
+ else
+ {
+ free (regs.start);
+ free (regs.end);
+ }
+ regfree (&regex);
+ }
memset (&regex, 0, sizeof regex);
s = re_compile_pattern ("x", 1, &regex);
if (s)
result |= 8;
- /* glibc-2.2.93 does not work with a negative RANGE argument. */
- else if (re_search (&regex, "wxy", 3, 2, -2, &regs) != 1)
- result |= 8;
+ else
+ {
+ /* glibc-2.2.93 does not work with a negative RANGE argument. */
+ if (re_search (&regex, "wxy", 3, 2, -2, &regs) != 1)
+ result |= 8;
+ else
+ {
+ free (regs.start);
+ free (regs.end);
+ }
+ regfree (&regex);
+ }
/* The version of regex.c in older versions of gnulib
ignored RE_ICASE. Detect that problem too. */
@@ -194,8 +227,17 @@ AC_DEFUN([gl_REGEX],
s = re_compile_pattern ("x", 1, &regex);
if (s)
result |= 16;
- else if (re_search (&regex, "WXY", 3, 0, 3, &regs) < 0)
- result |= 16;
+ else
+ {
+ if (re_search (&regex, "WXY", 3, 0, 3, &regs) < 0)
+ result |= 16;
+ else
+ {
+ free (regs.start);
+ free (regs.end);
+ }
+ regfree (&regex);
+ }
/* Catch a bug reported by Vin Shelton in
https://lists.gnu.org/r/bug-coreutils/2007-06/msg00089.html
@@ -207,6 +249,8 @@ AC_DEFUN([gl_REGEX],
s = re_compile_pattern ("[[:alnum:]_-]\\\\+$", 16, &regex);
if (s)
result |= 32;
+ else
+ regfree (&regex);
/* REG_STARTEND was added to glibc on 2004-01-15.
Reject older versions. */
@@ -221,8 +265,14 @@ AC_DEFUN([gl_REGEX],
re_set_syntax (RE_SYNTAX_POSIX_EGREP);
memset (&regex, 0, sizeof regex);
s = re_compile_pattern ("0|()0|\\1|0", 10, &regex);
- if (!s || strcmp (s, "Invalid back reference"))
+ if (!s)
result |= 64;
+ else
+ {
+ if (strcmp (s, "Invalid back reference"))
+ result |= 64;
+ regfree (&regex);
+ }
#if 0
/* It would be nice to reject hosts whose regoff_t values are too
diff --git a/m4/sys_random_h.m4 b/m4/sys_random_h.m4
new file mode 100644
index 00000000000..a964b157841
--- /dev/null
+++ b/m4/sys_random_h.m4
@@ -0,0 +1,52 @@
+# sys_random_h.m4 serial 4
+dnl Copyright (C) 2020 Free Software Foundation, Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+
+AC_DEFUN([gl_HEADER_SYS_RANDOM],
+[
+ AC_REQUIRE([gl_SYS_RANDOM_H_DEFAULTS])
+ dnl <sys/random.h> is always overridden, because of GNULIB_POSIXCHECK.
+ gl_CHECK_NEXT_HEADERS([sys/random.h])
+ if test $ac_cv_header_sys_random_h = yes; then
+ HAVE_SYS_RANDOM_H=1
+ else
+ HAVE_SYS_RANDOM_H=0
+ fi
+ AC_SUBST([HAVE_SYS_RANDOM_H])
+
+ m4_ifdef([gl_UNISTD_H_DEFAULTS], [AC_REQUIRE([gl_UNISTD_H_DEFAULTS])])
+ if test $ac_cv_header_sys_random_h = yes; then
+ UNISTD_H_HAVE_SYS_RANDOM_H=1
+ fi
+
+ dnl Check for declarations of anything we want to poison if the
+ dnl corresponding gnulib module is not in use.
+ gl_WARN_ON_USE_PREPARE([[
+#if HAVE_SYS_RANDOM_H
+/* Additional includes are needed before <sys/random.h> on Mac OS X. */
+# include <sys/types.h>
+# include <stdlib.h>
+# include <sys/random.h>
+#endif
+ ]],
+ [getrandom])
+])
+
+AC_DEFUN([gl_SYS_RANDOM_MODULE_INDICATOR],
+[
+ dnl Use AC_REQUIRE here, so that the default settings are expanded once only.
+ AC_REQUIRE([gl_SYS_RANDOM_H_DEFAULTS])
+ gl_MODULE_INDICATOR_SET_VARIABLE([$1])
+ dnl Define it also as a C macro, for the benefit of the unit tests.
+ gl_MODULE_INDICATOR_FOR_TESTS([$1])
+])
+
+AC_DEFUN([gl_SYS_RANDOM_H_DEFAULTS],
+[
+ GNULIB_GETRANDOM=0; AC_SUBST([GNULIB_GETRANDOM])
+ dnl Assume proper GNU behavior unless another module says otherwise.
+ HAVE_GETRANDOM=1; AC_SUBST([HAVE_GETRANDOM])
+ REPLACE_GETRANDOM=0; AC_SUBST([REPLACE_GETRANDOM])
+])
diff --git a/m4/unistd_h.m4 b/m4/unistd_h.m4
index e776f3bd445..dfa38f85d60 100644
--- a/m4/unistd_h.m4
+++ b/m4/unistd_h.m4
@@ -1,4 +1,4 @@
-# unistd_h.m4 serial 78
+# unistd_h.m4 serial 80
dnl Copyright (C) 2006-2020 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
@@ -43,7 +43,7 @@ AC_DEFUN([gl_UNISTD_H],
#endif
]], [access chdir chown dup dup2 dup3 environ euidaccess faccessat fchdir
fchownat fdatasync fsync ftruncate getcwd getdomainname getdtablesize
- getgroups gethostname getlogin getlogin_r getpagesize getpass
+ getentropy getgroups gethostname getlogin getlogin_r getpagesize getpass
getusershell setusershell endusershell
group_member isatty lchown link linkat lseek pipe pipe2 pread pwrite
readlink readlinkat rmdir sethostname sleep symlink symlinkat
@@ -82,6 +82,7 @@ AC_DEFUN([gl_UNISTD_H_DEFAULTS],
GNULIB_GETCWD=0; AC_SUBST([GNULIB_GETCWD])
GNULIB_GETDOMAINNAME=0; AC_SUBST([GNULIB_GETDOMAINNAME])
GNULIB_GETDTABLESIZE=0; AC_SUBST([GNULIB_GETDTABLESIZE])
+ GNULIB_GETENTROPY=0; AC_SUBST([GNULIB_GETENTROPY])
GNULIB_GETGROUPS=0; AC_SUBST([GNULIB_GETGROUPS])
GNULIB_GETHOSTNAME=0; AC_SUBST([GNULIB_GETHOSTNAME])
GNULIB_GETLOGIN=0; AC_SUBST([GNULIB_GETLOGIN])
@@ -129,6 +130,7 @@ AC_DEFUN([gl_UNISTD_H_DEFAULTS],
HAVE_FSYNC=1; AC_SUBST([HAVE_FSYNC])
HAVE_FTRUNCATE=1; AC_SUBST([HAVE_FTRUNCATE])
HAVE_GETDTABLESIZE=1; AC_SUBST([HAVE_GETDTABLESIZE])
+ HAVE_GETENTROPY=1; AC_SUBST([HAVE_GETENTROPY])
HAVE_GETGROUPS=1; AC_SUBST([HAVE_GETGROUPS])
HAVE_GETHOSTNAME=1; AC_SUBST([HAVE_GETHOSTNAME])
HAVE_GETLOGIN=1; AC_SUBST([HAVE_GETLOGIN])
@@ -198,6 +200,7 @@ AC_DEFUN([gl_UNISTD_H_DEFAULTS],
REPLACE_UNLINKAT=0; AC_SUBST([REPLACE_UNLINKAT])
REPLACE_USLEEP=0; AC_SUBST([REPLACE_USLEEP])
REPLACE_WRITE=0; AC_SUBST([REPLACE_WRITE])
+ UNISTD_H_HAVE_SYS_RANDOM_H=0; AC_SUBST([UNISTD_H_HAVE_SYS_RANDOM_H])
UNISTD_H_HAVE_WINSOCK2_H=0; AC_SUBST([UNISTD_H_HAVE_WINSOCK2_H])
UNISTD_H_HAVE_WINSOCK2_H_AND_USE_SOCKETS=0;
AC_SUBST([UNISTD_H_HAVE_WINSOCK2_H_AND_USE_SOCKETS])