From cd49a63b7bcaee5b7f9e21f8a8e0440b7ee676b9 Mon Sep 17 00:00:00 2001 From: nick black Date: Fri, 16 Jul 2021 00:00:58 -0400 Subject: [PATCH] only use MAP_SHARED_VALIDATE where defined #1941 --- src/lib/png.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/lib/png.c b/src/lib/png.c index 988bcebff..76f7f2c46 100644 --- a/src/lib/png.c +++ b/src/lib/png.c @@ -263,7 +263,11 @@ void* create_png_mmap(const ncvisual* ncv, size_t* bsize, int fd){ } // FIXME hugetlb? void* map = mmap(NULL, mlen, PROT_WRITE | PROT_READ, +#ifdef MAP_SHARED_VALIDATE MAP_SHARED_VALIDATE | +#else + MAP_SHARED | +#endif (fd >= 0 ? 0 : MAP_ANONYMOUS), fd, 0); if(map == MAP_FAILED){ logerror("Couldn't get %zuB map for %d\n", mlen, fd);