From ee0777586c8cbfc3506e0fff37d194d8b2ed2523 Mon Sep 17 00:00:00 2001 From: David Olsen Date: Mon, 30 Oct 2023 12:48:15 -0700 Subject: [PATCH] Disable io_uring tests on Linux kernel < 5.4 Some Linux distributions have , but fail with "Operation not permitted" on syscall(__NR_io_uring_setup, __entries, &__params) To work around this, skip the entire test when running on a system with a Linux kernel older than 5.4. (I am not certain that this is the correct check. But it is the best I could come up with in testing on our systems.) --- test/exec/test_io_uring_context.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/test/exec/test_io_uring_context.cpp b/test/exec/test_io_uring_context.cpp index 0516940e4..f294e6529 100644 --- a/test/exec/test_io_uring_context.cpp +++ b/test/exec/test_io_uring_context.cpp @@ -15,7 +15,12 @@ * limitations under the License. */ -#if __has_include() +#include + +// Some kernel versions have but don't support or don't +// allow user access to some of the necessary system calls. +#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 4, 0) && __has_include() + #include "exec/linux/io_uring_context.hpp" #include "exec/scope.hpp" #include "exec/single_thread_context.hpp"