Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/tests/lib/libc/sys Allow the test to build on systems where ...
details: https://anonhg.NetBSD.org/src/rev/0955604c9e87
branches: trunk
changeset: 356101:0955604c9e87
user: kre <kre%NetBSD.org@localhost>
date: Fri Sep 01 16:51:58 2017 +0000
description:
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.
diffstat:
tests/lib/libc/sys/t_mincore.c | 8 ++++++--
1 files changed, 6 insertions(+), 2 deletions(-)
diffs (29 lines):
diff -r acc91cd3d3d7 -r 0955604c9e87 tests/lib/libc/sys/t_mincore.c
--- a/tests/lib/libc/sys/t_mincore.c Fri Sep 01 16:27:02 2017 +0000
+++ b/tests/lib/libc/sys/t_mincore.c Fri Sep 01 16:51:58 2017 +0000
@@ -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 @@
#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)
{
Home |
Main Index |
Thread Index |
Old Index