From owner-svn-src-head@FreeBSD.ORG Sat Nov 1 20:45:46 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 260ADF91; Sat, 1 Nov 2014 20:45:46 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id EC04F338; Sat, 1 Nov 2014 20:45:45 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sA1Kjjxd036934; Sat, 1 Nov 2014 20:45:45 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sA1KjjgO036933; Sat, 1 Nov 2014 20:45:45 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201411012045.sA1KjjgO036933@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Sat, 1 Nov 2014 20:45:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r273945 - head/contrib/netbsd-tests/lib/libc/sys X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 01 Nov 2014 20:45:46 -0000 Author: ngie Date: Sat Nov 1 20:45:45 2014 New Revision: 273945 URL: https://svnweb.freebsd.org/changeset/base/273945 Log: Port t_mincore to FreeBSD Mark :mincore_resid as atf_tc_expect_fail on FreeBSD because of new bug discovered in running the tests (it succeeded from earlier on in the year to September/October on FreeBSD, at least) Submitted by: pho Modified: head/contrib/netbsd-tests/lib/libc/sys/t_mincore.c Modified: head/contrib/netbsd-tests/lib/libc/sys/t_mincore.c ============================================================================== --- head/contrib/netbsd-tests/lib/libc/sys/t_mincore.c Sat Nov 1 20:41:47 2014 (r273944) +++ head/contrib/netbsd-tests/lib/libc/sys/t_mincore.c Sat Nov 1 20:45:45 2014 (r273945) @@ -74,6 +74,10 @@ __RCSID("$NetBSD: t_mincore.c,v 1.8 2012 #include #include +#ifdef __FreeBSD__ +#include +#endif + static long page = 0; static const char path[] = "mincore"; static size_t check_residency(void *, size_t); @@ -121,8 +125,10 @@ ATF_TC_BODY(mincore_err, tc) ATF_REQUIRE(vec != NULL); ATF_REQUIRE(map != MAP_FAILED); +#ifdef __NetBSD__ errno = 0; ATF_REQUIRE_ERRNO(EINVAL, mincore(map, 0, vec) == -1); +#endif errno = 0; ATF_REQUIRE_ERRNO(ENOMEM, mincore(0, page, vec) == -1); @@ -187,13 +193,24 @@ ATF_TC_BODY(mincore_resid, tc) npgs = 128; +#ifdef __FreeBSD__ + addr = mmap(NULL, npgs * page, PROT_READ | PROT_WRITE, + MAP_ANON | MAP_PRIVATE, -1, (off_t)0); +#else addr = mmap(NULL, npgs * page, PROT_READ | PROT_WRITE, MAP_ANON | MAP_PRIVATE | MAP_WIRED, -1, (off_t)0); +#endif if (addr == MAP_FAILED) atf_tc_skip("could not mmap wired anonymous test area, system " "might be low on memory"); +#ifdef __FreeBSD__ + atf_tc_expect_fail("the following calls fail; this seems to be a new " + "issue (didn't occur in 07/2014)"); + + ATF_REQUIRE(mlock(addr, npgs * page) == 0); +#endif ATF_REQUIRE(check_residency(addr, npgs) == npgs); ATF_REQUIRE(munmap(addr, npgs * page) == 0); @@ -238,12 +255,16 @@ ATF_TC_BODY(mincore_resid, tc) (void)munlockall(); ATF_REQUIRE(madvise(addr2, npgs * page, MADV_FREE) == 0); +#ifdef __NetBSD__ ATF_REQUIRE(check_residency(addr2, npgs) == 0); +#endif (void)memset(addr, 0, npgs * page); ATF_REQUIRE(madvise(addr, npgs * page, MADV_FREE) == 0); +#ifdef __NetBSD__ ATF_REQUIRE(check_residency(addr, npgs) == 0); +#endif (void)munmap(addr, npgs * page); (void)munmap(addr2, npgs * page);