Module Name:    src
Committed By:   njoly
Date:           Fri May  6 21:51:19 UTC 2011

Modified Files:
        src/tests/syscall: t_mprotect.c

Log Message:
write-only mapping is not portable, change it to read/write. Unbreaks
mprotect_write testcase on alpha.


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/tests/syscall/t_mprotect.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/syscall/t_mprotect.c
diff -u src/tests/syscall/t_mprotect.c:1.4 src/tests/syscall/t_mprotect.c:1.5
--- src/tests/syscall/t_mprotect.c:1.4	Mon Apr 25 22:29:35 2011
+++ src/tests/syscall/t_mprotect.c	Fri May  6 21:51:19 2011
@@ -1,4 +1,4 @@
-/* $NetBSD: t_mprotect.c,v 1.4 2011/04/25 22:29:35 njoly Exp $ */
+/* $NetBSD: t_mprotect.c,v 1.5 2011/05/06 21:51:19 njoly Exp $ */
 
 /*-
  * Copyright (c) 2011 The NetBSD Foundation, Inc.
@@ -29,7 +29,7 @@
  * POSSIBILITY OF SUCH DAMAGE.
  */
 #include <sys/cdefs.h>
-__RCSID("$NetBSD: t_mprotect.c,v 1.4 2011/04/25 22:29:35 njoly Exp $");
+__RCSID("$NetBSD: t_mprotect.c,v 1.5 2011/05/06 21:51:19 njoly Exp $");
 
 #include <sys/param.h>
 #include <sys/mman.h>
@@ -236,11 +236,11 @@
 	int sta;
 
 	/*
-	 * Map a page write-only, change the protection
+	 * Map a page read/write, change the protection
 	 * to read-only with mprotect(2), and try to write
 	 * to the page. This should generate a SIGSEGV.
 	 */
-	map = mmap(NULL, page, PROT_WRITE, MAP_ANON, -1, 0);
+	map = mmap(NULL, page, PROT_WRITE|PROT_READ, MAP_ANON, -1, 0);
 
 	if (map == MAP_FAILED)
 		return;

Reply via email to