Module Name:    src
Committed By:   jruoho
Date:           Wed Mar 14 11:50:53 UTC 2012

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

Log Message:
Skip the ENOMEM/RLIMIT_MEMLOCK case when doing mlockall(2).


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 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.3 src/tests/lib/libc/sys/t_mincore.c:1.4
--- src/tests/lib/libc/sys/t_mincore.c:1.3	Thu Jul 14 10:24:56 2011
+++ src/tests/lib/libc/sys/t_mincore.c	Wed Mar 14 11:50:52 2012
@@ -1,4 +1,4 @@
-/* $NetBSD: t_mincore.c,v 1.3 2011/07/14 10:24:56 jruoho Exp $ */
+/* $NetBSD: t_mincore.c,v 1.4 2012/03/14 11:50:52 jruoho 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.3 2011/07/14 10:24:56 jruoho Exp $");
+__RCSID("$NetBSD: t_mincore.c,v 1.4 2012/03/14 11:50:52 jruoho Exp $");
 
 #include <sys/mman.h>
 #include <sys/shm.h>
@@ -205,7 +205,12 @@ ATF_TC_BODY(mincore_resid, tc)
 	 * Check that the in-core pages match the locked pages.
 	 */
 	ATF_REQUIRE(check_residency(addr, npgs) == 0);
-	ATF_REQUIRE(mlockall(MCL_CURRENT|MCL_FUTURE) == 0);
+
+	errno = 0;
+
+	if (mlockall(MCL_CURRENT|MCL_FUTURE) != 0 && errno != ENOMEM)
+		atf_tc_fail("mlockall(2) failed");
+
 	ATF_REQUIRE(check_residency(addr, npgs) == npgs);
 
 	addr2 = mmap(NULL, npgs * page, PROT_READ, MAP_ANON, -1, (off_t)0);

Reply via email to