Index: contrib/netbsd-tests/lib/libc/sys/t_mincore.c =================================================================== --- contrib/netbsd-tests/lib/libc/sys/t_mincore.c +++ contrib/netbsd-tests/lib/libc/sys/t_mincore.c @@ -76,6 +76,24 @@ #ifdef __FreeBSD__ #include +#include +#include +#include + +#define VM_MAX_WIRED "vm.max_wired" + +int old_max_wired; + +static void +set_vm_max_wired(int new_max_wired) +{ + + ATF_REQUIRE(new_max_wired > 0); + ATF_REQUIRE_MSG(sysctlbyname(VM_MAX_WIRED, NULL, 0, &new_max_wired, + sizeof(new_max_wired)) == 0, + "failed to set %s to %d: %s", VM_MAX_WIRED, new_max_wired, + strerror(errno)); +} #endif static long page = 0; @@ -144,6 +162,9 @@ 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) @@ -158,6 +179,11 @@ rlim.rlim_cur = rlim.rlim_max; ATF_REQUIRE(setrlimit(RLIMIT_MEMLOCK, &rlim) == 0); +#ifdef __FreeBSD__ + /* Set max_wired really really high to avoid EAGAIN */ + set_vm_max_wired(INT_MAX); +#endif + (void)memset(&st, 0, sizeof(struct stat)); fd = open(path, O_RDWR | O_CREAT, 0700); @@ -271,6 +297,9 @@ ATF_TC_CLEANUP(mincore_resid, tc) { +#ifdef __FreeBSD__ + set_vm_max_wired(old_max_wired); +#endif (void)unlink(path); } @@ -324,6 +353,13 @@ ATF_TP_ADD_TCS(tp) { +#ifdef __FreeBSD__ + size_t old_max_wired_size = sizeof(old_max_wired); + + if (sysctlbyname(VM_MAX_WIRED, &old_max_wired, + &old_max_wired_size, NULL, 0) == -1) + warn("could not query %s", VM_MAX_WIRED); +#endif page = sysconf(_SC_PAGESIZE); ATF_REQUIRE(page >= 0); Index: sys/geom/uzip/g_uzip.c =================================================================== --- sys/geom/uzip/g_uzip.c +++ sys/geom/uzip/g_uzip.c @@ -44,7 +44,7 @@ FEATURE(geom_uzip, "GEOM uzip read-only compressed disks support"); -#undef GEOM_UZIP_DEBUG +#define GEOM_UZIP_DEBUG #ifdef GEOM_UZIP_DEBUG #define DPRINTF(a) printf a #else @@ -94,8 +94,8 @@ { if (gp != NULL) { - printf("%s: %d requests, %d cached\n", - gp->name, sc->req_total, sc->req_cached); + DPRINTF(("%s: %d requests, %d cached\n", + gp->name, sc->req_total, sc->req_cached)); } if (sc->offsets != NULL) { free(sc->offsets, M_GEOM_UZIP); @@ -519,7 +519,7 @@ gp->name, pp2->sectorsize, (intmax_t)pp2->mediasize, pp2->stripeoffset, pp2->stripesize, pp2->flags)); - printf("%s: %u x %u blocks\n", gp->name, sc->nblocks, sc->blksz); + DPRINTF(("%s: %u x %u blocks\n", gp->name, sc->nblocks, sc->blksz)); return (gp); err: @@ -547,7 +547,7 @@ g_topology_assert(); if (gp->softc == NULL) { - printf("%s(%s): gp->softc == NULL\n", __func__, gp->name); + DPRINTF(("%s(%s): gp->softc == NULL\n", __func__, gp->name)); return (ENXIO); }