summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--test/timeout-overflow.c17
1 files changed, 14 insertions, 3 deletions
diff --git a/test/timeout-overflow.c b/test/timeout-overflow.c
index 1074e2b..f952f80 100644
--- a/test/timeout-overflow.c
+++ b/test/timeout-overflow.c
@@ -6,6 +6,7 @@
#include <errno.h>
#include <stdio.h>
#include <limits.h>
+#include <string.h>
#include <sys/time.h>
#include "liburing.h"
@@ -19,19 +20,29 @@ static void msec_to_ts(struct __kernel_timespec *ts, unsigned int msec)
ts->tv_nsec = (msec % 1000) * 1000000;
}
-static int check_timeout_support()
+static int check_timeout_support(void)
{
struct io_uring_sqe *sqe;
struct io_uring_cqe *cqe;
struct __kernel_timespec ts;
+ struct io_uring_params p;
struct io_uring ring;
int ret;
- ret = io_uring_queue_init(8, &ring, 0);
+ memset(&p, 0, sizeof(p));
+ ret = io_uring_queue_init_params(1, &ring, &p);
if (ret) {
fprintf(stderr, "ring setup failed: %d\n", ret);
return 1;
}
+
+ /* not really a match, but same kernel added batched completions */
+ if (p.features & IORING_FEAT_POLL_32BITS) {
+ fprintf(stdout, "Skipping\n");
+ not_supported = 1;
+ return 0;
+ }
+
sqe = io_uring_get_sqe(&ring);
msec_to_ts(&ts, TIMEOUT_MSEC);
io_uring_prep_timeout(sqe, &ts, 1, 0);
@@ -74,7 +85,7 @@ err:
* successful after the patch. And req1/req2 will completed successful with
* req3/req4 return -ETIME without this patch!
*/
-static int test_timeout_overflow()
+static int test_timeout_overflow(void)
{
struct io_uring_sqe *sqe;
struct io_uring_cqe *cqe;