diff --git a/tools/testing/selftests/futex/functional/futex_numa_mpol.c b/tools/testing/selftests/futex/functional/futex_numa_mpol.c index c79184ff344a..4ffcf41efe1f 100644 --- a/tools/testing/selftests/futex/functional/futex_numa_mpol.c +++ b/tools/testing/selftests/futex/functional/futex_numa_mpol.c @@ -107,6 +107,9 @@ static void __test_futex(struct __test_metadata *_metadata, void *futex_ptr, int break; } if (ret < 0) { + if (errno == ENOSYS || (errno == EINVAL && (futex_flags & FUTEX2_NUMA))) + SKIP(return, "futex2 or FUTEX2_NUMA not supported by kernel"); + ASSERT_GE(ret, 0) { TH_LOG("Failed futex2_wake(%d, 0x%x): %s", to_wake, futex_flags, strerror(errno)); diff --git a/tools/testing/selftests/futex/functional/futex_priv_hash.c b/tools/testing/selftests/futex/functional/futex_priv_hash.c index a742a797fd0f..a8742e204540 100644 --- a/tools/testing/selftests/futex/functional/futex_priv_hash.c +++ b/tools/testing/selftests/futex/functional/futex_priv_hash.c @@ -143,6 +143,9 @@ TEST(priv_hash) /* First thread, expect to be 0, not yet initialized */ ret = futex_hash_slots_get(); + if (ret < 0 && errno == EINVAL) + SKIP(return, "PR_FUTEX_HASH not supported by kernel"); + ASSERT_EQ(ret, 0) TH_LOG("futex_hash_slots_get() failed: %d, %s", ret, strerror(errno));