git: afddaa36e4ab - stable/13 - posixshm tests: Map the large pages in the madvise test

From: Mark Johnston <markj_at_FreeBSD.org>
Date: Mon, 03 Oct 2022 13:11:57 UTC
The branch stable/13 has been updated by markj:

URL: https://cgit.FreeBSD.org/src/commit/?id=afddaa36e4ab39f1500a45e9eddd546166de64a1

commit afddaa36e4ab39f1500a45e9eddd546166de64a1
Author:     Mark Johnston <markj@FreeBSD.org>
AuthorDate: 2022-09-26 12:58:10 +0000
Commit:     Mark Johnston <markj@FreeBSD.org>
CommitDate: 2022-10-03 13:06:32 +0000

    posixshm tests: Map the large pages in the madvise test
    
    This improves test coverage and was unintentionally omitted when the
    tests were written.
    
    (cherry picked from commit e4eedf8c31a2693f07628d3b0433c6d398fdb6cd)
---
 tests/sys/posixshm/posixshm_test.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/tests/sys/posixshm/posixshm_test.c b/tests/sys/posixshm/posixshm_test.c
index 2f2c6eb5fc80..6329f0eb4f7d 100644
--- a/tests/sys/posixshm/posixshm_test.c
+++ b/tests/sys/posixshm/posixshm_test.c
@@ -1271,6 +1271,8 @@ ATF_TC_BODY(largepage_madvise, tc)
 		ATF_REQUIRE_MSG(addr != MAP_FAILED,
 		    "mmap(%zu bytes) failed; error=%d", ps[i], errno);
 
+		memset(addr, 0, ps[i]);
+
 		/* Advice that requires clipping. */
 		largepage_madvise(addr, PAGE_SIZE, MADV_NORMAL, EINVAL);
 		largepage_madvise(addr, ps[i], MADV_NORMAL, 0);