Module Name:    src
Committed By:   kre
Date:           Fri Sep  1 16:51:58 UTC 2017

Modified Files:
        src/tests/lib/libc/sys: t_mincore.c

Log Message:
Allow the test to build on systems where sys/mman.h does not provide
PROT_MPROTECT(), or if the test is built without _NETBSD_SOURCE defined,
by providing a dummy #define if the real one does not exist.  The test
might then fail, if the PROT_MPROTECT() is really needed, but that's
better than not building.


To generate a diff of this commit:
cvs rdiff -u -r1.12 -r1.13 src/tests/lib/libc/sys/t_mincore.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/tests/lib/libc/sys/t_mincore.c
diff -u src/tests/lib/libc/sys/t_mincore.c:1.12 src/tests/lib/libc/sys/t_mincore.c:1.13
--- src/tests/lib/libc/sys/t_mincore.c:1.12	Fri Sep  1 16:27:02 2017
+++ src/tests/lib/libc/sys/t_mincore.c	Fri Sep  1 16:51:58 2017
@@ -1,4 +1,4 @@
-/* $NetBSD: t_mincore.c,v 1.12 2017/09/01 16:27:02 kre Exp $ */
+/* $NetBSD: t_mincore.c,v 1.13 2017/09/01 16:51:58 kre Exp $ */
 
 /*-
  * Copyright (c) 2011 The NetBSD Foundation, Inc.
@@ -59,7 +59,7 @@
  * POSSIBILITY OF SUCH DAMAGE.
  */
 #include <sys/cdefs.h>
-__RCSID("$NetBSD: t_mincore.c,v 1.12 2017/09/01 16:27:02 kre Exp $");
+__RCSID("$NetBSD: t_mincore.c,v 1.13 2017/09/01 16:51:58 kre Exp $");
 
 #include <sys/mman.h>
 #include <sys/stat.h>
@@ -81,6 +81,10 @@ static size_t		check_residency(void *, s
 
 #define ATF_REQUIRE_STRERROR(a) ATF_REQUIRE_MSG(a, " (%s)", strerror(errno))
 
+#ifndef PROT_MPROTECT
+# define PROT_MPROTECT(flags)	(0)
+#endif
+
 static size_t
 check_residency(void *addr, size_t npgs)
 {

Reply via email to