helpers: add io_uring_posix_memalign helper
add io_uring_posix_memalign helper, and replace
all posix_memalign() with io_uring_posix_memalign()
in all tests.
Signed-off-by: Zhiqiang Liu <[email protected]>
diff --git a/test/helpers.c b/test/helpers.c
index 7acf184..83ed3e5 100644
--- a/test/helpers.c
+++ b/test/helpers.c
@@ -17,3 +17,14 @@
assert(ret);
return ret;
}
+
+
+/*
+ * Helper for allocating size bytes aligned on a boundary.
+ */
+void io_uring_posix_memalign(void **memptr, size_t alignment, size_t size)
+{
+ int ret;
+ ret = posix_memalign(memptr, alignment, size);
+ assert(!ret);
+}