diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-19 06:03:02 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-19 06:03:02 +0000 |
commit | 4897093455a2bf08f3db3a1132cc2f6f5484d77c (patch) | |
tree | 9e6373544263f003139431fb4b08f9766e1ed530 /aclocal/getrandom.m4 | |
parent | Initial commit. (diff) | |
download | nfs-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.m4 | 16 |
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) +]) |