summaryrefslogtreecommitdiffstats
path: root/aclocal/getrandom.m4
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-19 06:03:02 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-19 06:03:02 +0000
commit4897093455a2bf08f3db3a1132cc2f6f5484d77c (patch)
tree9e6373544263f003139431fb4b08f9766e1ed530 /aclocal/getrandom.m4
parentInitial commit. (diff)
downloadnfs-utils-upstream.tar.xz
nfs-utils-upstream.zip
Adding upstream version 1:2.6.4.upstream/1%2.6.4upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to '')
-rw-r--r--aclocal/getrandom.m416
1 files changed, 16 insertions, 0 deletions
diff --git a/aclocal/getrandom.m4 b/aclocal/getrandom.m4
new file mode 100644
index 0000000..bc0fe16
--- /dev/null
+++ b/aclocal/getrandom.m4
@@ -0,0 +1,16 @@
+dnl Checks for getrandom support (glibc 2.25+, musl 1.1.20+)
+dnl
+AC_DEFUN([AC_GETRANDOM], [
+ AC_MSG_CHECKING(for getrandom())
+ AC_LINK_IFELSE(
+ [AC_LANG_PROGRAM([[
+ #include <stdlib.h> /* for NULL */
+ #include <sys/random.h>
+ ]],
+ [[ return getrandom(NULL, 0U, 0U); ]] )],
+ [AC_DEFINE([HAVE_GETRANDOM], [1], [Define to 1 if you have the `getrandom' function.])
+ AC_MSG_RESULT([yes])],
+ [AC_MSG_RESULT([no])])
+
+ AC_SUBST(HAVE_GETRANDOM)
+])