From 6144b07f9b424836f6810e06048cbb35a9ce2f34 Mon Sep 17 00:00:00 2001 From: Enji Cooper Date: Wed, 27 Jan 2016 07:06:49 +0000 Subject: [PATCH] Add debug output via ATF_REQUIRE_MSG when the first call to mlock(2) fails This helps identify the problem with running this test on my VM hosts (ENOMEM) MFC after: 3 days Sponsored by: EMC / Isilon Storage Division --- contrib/netbsd-tests/lib/libc/sys/t_mincore.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/contrib/netbsd-tests/lib/libc/sys/t_mincore.c b/contrib/netbsd-tests/lib/libc/sys/t_mincore.c index 499493f380a..872856eba46 100644 --- a/contrib/netbsd-tests/lib/libc/sys/t_mincore.c +++ b/contrib/netbsd-tests/lib/libc/sys/t_mincore.c @@ -206,7 +206,8 @@ ATF_TC_BODY(mincore_resid, tc) "might be low on memory"); #ifdef __FreeBSD__ - ATF_REQUIRE(mlock(addr, npgs * page) == 0); + ATF_REQUIRE_MSG(mlock(addr, npgs * page) == 0, "mlock failed: %s", + strerror(errno)); #endif ATF_REQUIRE(check_residency(addr, npgs) == npgs); ATF_REQUIRE(munmap(addr, npgs * page) == 0);