Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/tests/syscall write-only mapping is not portable, change it ...



details:   https://anonhg.NetBSD.org/src/rev/6d5c564722e6
branches:  trunk
changeset: 764827:6d5c564722e6
user:      njoly <njoly%NetBSD.org@localhost>
date:      Fri May 06 21:51:19 2011 +0000

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

diffstat:

 tests/syscall/t_mprotect.c |  8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)

diffs (32 lines):

diff -r 9b957fe2f5d4 -r 6d5c564722e6 tests/syscall/t_mprotect.c
--- a/tests/syscall/t_mprotect.c        Fri May 06 21:48:46 2011 +0000
+++ b/tests/syscall/t_mprotect.c        Fri May 06 21:51:19 2011 +0000
@@ -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;



Home | Main Index | Thread Index | Old Index