diff options
author | Luiz Otavio O Souza <luiz@netgate.com> | 2016-12-30 20:30:00 -0600 |
---|---|---|
committer | Luiz Otavio O Souza <luiz@netgate.com> | 2016-12-30 20:30:00 -0600 |
commit | 1af1408e09373ae856cfef567d79849c7e7e0d25 (patch) | |
tree | 8a4a2bc017c297dea8c977c53f8c1099e26edbe6 /contrib/netbsd-tests/lib/libc | |
parent | ba2be30f109cb2d0c83d41dff268b04f085252b4 (diff) | |
parent | 0591c0c87ec4e420c1a1e9a0c10f761ff4a832c2 (diff) | |
download | FreeBSD-src-1af1408e09373ae856cfef567d79849c7e7e0d25.zip FreeBSD-src-1af1408e09373ae856cfef567d79849c7e7e0d25.tar.gz |
Merge remote-tracking branch 'origin/stable/11' into devel-11
Diffstat (limited to 'contrib/netbsd-tests/lib/libc')
-rw-r--r-- | contrib/netbsd-tests/lib/libc/sys/t_mincore.c | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/contrib/netbsd-tests/lib/libc/sys/t_mincore.c b/contrib/netbsd-tests/lib/libc/sys/t_mincore.c index 872856e..72355e2 100644 --- a/contrib/netbsd-tests/lib/libc/sys/t_mincore.c +++ b/contrib/netbsd-tests/lib/libc/sys/t_mincore.c @@ -144,6 +144,9 @@ ATF_TC_WITH_CLEANUP(mincore_resid); ATF_TC_HEAD(mincore_resid, tc) { atf_tc_set_md_var(tc, "descr", "Test page residency with mincore(2)"); +#ifdef __FreeBSD__ + atf_tc_set_md_var(tc, "require.user", "root"); +#endif } ATF_TC_BODY(mincore_resid, tc) @@ -155,6 +158,13 @@ ATF_TC_BODY(mincore_resid, tc) struct rlimit rlim; ATF_REQUIRE(getrlimit(RLIMIT_MEMLOCK, &rlim) == 0); +#ifdef __FreeBSD__ + /* + * Bump the mlock limit to unlimited so the rest of the testcase + * passes instead of failing on the mlock call. + */ + rlim.rlim_max = RLIM_INFINITY; +#endif rlim.rlim_cur = rlim.rlim_max; ATF_REQUIRE(setrlimit(RLIMIT_MEMLOCK, &rlim) == 0); @@ -206,8 +216,9 @@ ATF_TC_BODY(mincore_resid, tc) "might be low on memory"); #ifdef __FreeBSD__ - ATF_REQUIRE_MSG(mlock(addr, npgs * page) == 0, "mlock failed: %s", - strerror(errno)); + if (mlock(addr, npgs * page) == -1 && errno != ENOMEM) + atf_tc_skip("could not wire anonymous test area, system might " + "be low on memory"); #endif ATF_REQUIRE(check_residency(addr, npgs) == npgs); ATF_REQUIRE(munmap(addr, npgs * page) == 0); |