Some ndctl tests use two new mmap() flags named MAP_SHARED_VALIDATE
and MAP_SYNC that were added by linux kernel-4.15, intended to be
defined for applications by sys/mman.h. However, these do not exist
unless the distro has glibc-2.28.

In addition to the existing check for MAP_SYNC, check that
MAP_SHARED_VALIDATE is provided.

Fixes: 94679e6b78aa ("ndctl, test: check availability of MAP_SYNC for poison 
test")
Signed-off-by: Robert Elliott <[email protected]>
---
 configure.ac | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/configure.ac b/configure.ac
index d27a2b1..efbdcde 100644
--- a/configure.ac
+++ b/configure.ac
@@ -103,12 +103,13 @@ AS_IF([test "x$enable_test" = "xyes"],
 AM_CONDITIONAL([ENABLE_TEST], [test "x$enable_test" = "xyes"])
 
 AC_CHECK_DECLS([BUS_MCEERR_AR], [enable_bus_mc_err=yes], [], [[#include 
<signal.h>]])
+AC_CHECK_DECLS([MAP_SHARED_VALIDATE], [enable_map_shared_validate=yes], [], 
[[#include <sys/mman.h>]])
 AC_CHECK_DECLS([MAP_SYNC], [enable_map_sync=yes], [], [[#include 
<sys/mman.h>]])
 
-AS_IF([test "x$enable_bus_mc_err" = "xyes" -a "x$enable_map_sync" = "xyes"],
+AS_IF([test "x$enable_bus_mc_err" = "xyes" -a "x$enable_map_sync" = "xyes" -a 
"x$enable_map_shared_validate" = "xyes"],
        [AC_DEFINE([ENABLE_POISON], [1], [ndctl test poison support])])
 AM_CONDITIONAL([ENABLE_POISON],
-       [test "x$enable_bus_mc_err" = "xyes" -a "x$enable_map_sync" = "xyes"])
+       [test "x$enable_bus_mc_err" = "xyes" -a "x$enable_map_sync" = "xyes" -a 
"x$enable_map_shared_validate" = "xyes"])
 
 PKG_CHECK_MODULES([KMOD], [libkmod])
 PKG_CHECK_MODULES([UDEV], [libudev])
-- 
2.20.1

_______________________________________________
Linux-nvdimm mailing list
[email protected]
https://lists.01.org/mailman/listinfo/linux-nvdimm

Reply via email to