diff options
author | Android Build Coastguard Worker <android-build-coastguard-worker@google.com> | 2023-07-07 05:02:37 +0000 |
---|---|---|
committer | Android Build Coastguard Worker <android-build-coastguard-worker@google.com> | 2023-07-07 05:02:37 +0000 |
commit | 71927bc101a1c2e7360022c2a056f49106b722ea (patch) | |
tree | ebe9c872e416346e4b333e5062da32401c8e0a73 /test/sq-poll-kthread.c | |
parent | d53db6851ea17b2d219d084e1afc683b8b62b105 (diff) | |
parent | 1d27ff1934c5c4292dc00fba7f7f8ae411ed42f5 (diff) | |
download | liburing-android14-mainline-os-statsd-release.tar.gz |
Snap for 10453563 from 1d27ff1934c5c4292dc00fba7f7f8ae411ed42f5 to mainline-os-statsd-releaseaml_sta_341710000aml_sta_341615000aml_sta_341511040aml_sta_341410000aml_sta_341311010aml_sta_341114000aml_sta_341111000aml_sta_341010020aml_sta_340912000aml_sta_340911000aml_net_341111030android14-mainline-os-statsd-release
Change-Id: I92aad81dca3afa0dc7b00b53365472f7f29e4b40
Diffstat (limited to 'test/sq-poll-kthread.c')
-rw-r--r-- | test/sq-poll-kthread.c | 17 |
1 files changed, 8 insertions, 9 deletions
diff --git a/test/sq-poll-kthread.c b/test/sq-poll-kthread.c index ed7d0bf..3f4a07b 100644 --- a/test/sq-poll-kthread.c +++ b/test/sq-poll-kthread.c @@ -1,3 +1,4 @@ +/* SPDX-License-Identifier: MIT */ /* * Description: test if io_uring SQ poll kthread is stopped when the userspace * process ended with or without closing the io_uring fd @@ -12,11 +13,12 @@ #include <stdlib.h> #include <string.h> #include <signal.h> -#include <sys/poll.h> +#include <poll.h> #include <sys/wait.h> #include <sys/epoll.h> #include "liburing.h" +#include "helpers.h" #define SQ_THREAD_IDLE 2000 #define BUF_SIZE 128 @@ -38,23 +40,20 @@ static int do_test_sq_poll_kthread_stopped(bool do_exit) uint8_t buf[BUF_SIZE]; struct iovec iov; - if (geteuid()) { - fprintf(stderr, "sqpoll requires root!\n"); - return TEST_SKIPPED; - } - if (pipe(pipe1) != 0) { perror("pipe"); return TEST_FAILED; } memset(¶m, 0, sizeof(param)); - param.flags |= IORING_SETUP_SQPOLL; param.sq_thread_idle = SQ_THREAD_IDLE; - ret = io_uring_queue_init_params(16, &ring, ¶m); - if (ret) { + ret = t_create_ring_params(16, &ring, ¶m); + if (ret == T_SETUP_SKIP) { + ret = TEST_FAILED; + goto err_pipe; + } else if (ret != T_SETUP_OK) { fprintf(stderr, "ring setup failed\n"); ret = TEST_FAILED; goto err_pipe; |