diff --git a/tests/sys/posixshm/memfd_test.c b/tests/sys/posixshm/memfd_test.c index 387eca4cafe..9b4930a56f5 100644 --- a/tests/sys/posixshm/memfd_test.c +++ b/tests/sys/posixshm/memfd_test.c @@ -294,8 +294,11 @@ ATF_TC_BODY(hugetlb, tc) if (!MFD_HUGE_SUPPORTED(pgsize)) continue; - ATF_REQUIRE_MSG((fd = memfd_create("...", - MFD_HUGETLB | MFD_HUGE_FLAGS(pgsize))) != -1, + fd = memfd_create("...", MFD_HUGETLB | MFD_HUGE_FLAGS(pgsize)); + if (fd == -1 && errno == ENOTTY) + atf_tc_skip("large page requests are not supported on the current platform"); + + ATF_REQUIRE_MSG(fd != -1, "Creating a %zu-size hugetlb memfd", pgsize); }