summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorJens Axboe <axboe@kernel.dk>2020-02-25 21:32:48 -0700
committerJens Axboe <axboe@kernel.dk>2020-02-25 21:32:48 -0700
commit21892f510aa6e98f41020a594fcaaa86a93dcf0b (patch)
treee820dcc8700334666326e37d15e88c3b8684755d /test
parentbce5ec37d9ef3de076e6648ab39a38e5d30f5ad8 (diff)
downloadliburing-21892f510aa6e98f41020a594fcaaa86a93dcf0b.tar.gz
liburing-21892f510aa6e98f41020a594fcaaa86a93dcf0b.tar.bz2
test/read-write: fix non-root failure
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'test')
-rw-r--r--test/read-write.c13
1 files changed, 11 insertions, 2 deletions
diff --git a/test/read-write.c b/test/read-write.c
index 9396358..dfc541a 100644
--- a/test/read-write.c
+++ b/test/read-write.c
@@ -241,10 +241,19 @@ static int test_io(const char *file, int write, int buffered, int sqthread,
struct io_uring ring;
int ret, ring_flags;
- if (sqthread)
+ if (sqthread) {
+ if (geteuid()) {
+ static int warned;
+
+ if (!warned) {
+ fprintf(stderr, "SQPOLL requires root, skipping\n");
+ warned = 1;
+ }
+ }
ring_flags = IORING_SETUP_SQPOLL;
- else
+ } else {
ring_flags = 0;
+ }
ret = io_uring_queue_init(64, &ring, ring_flags);
if (ret) {