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 Skip the ENOMEM/RLIMIT_MEMLOCK case when ...
details: https://anonhg.NetBSD.org/src/rev/2f878c040b83
branches: trunk
changeset: 778047:2f878c040b83
user: jruoho <jruoho%NetBSD.org@localhost>
date: Wed Mar 14 11:50:52 2012 +0000
description:
Skip the ENOMEM/RLIMIT_MEMLOCK case when doing mlockall(2).
diffstat:
tests/lib/libc/sys/t_mincore.c | 11 ++++++++---
1 files changed, 8 insertions(+), 3 deletions(-)
diffs (32 lines):
diff -r c47be52421fc -r 2f878c040b83 tests/lib/libc/sys/t_mincore.c
--- a/tests/lib/libc/sys/t_mincore.c Wed Mar 14 11:44:42 2012 +0000
+++ b/tests/lib/libc/sys/t_mincore.c Wed Mar 14 11:50:52 2012 +0000
@@ -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 @@
* 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);
Home |
Main Index |
Thread Index |
Old Index