aboutsummaryrefslogtreecommitdiffstats
path: root/contrib/libs/liburing/test/accept.c
diff options
context:
space:
mode:
authorthegeorg <thegeorg@yandex-team.com>2024-06-09 11:55:21 +0300
committerthegeorg <thegeorg@yandex-team.com>2024-06-09 12:07:55 +0300
commitafd4899380eea1c70e2a68714b5da1c9919ccdbd (patch)
treecd5120708784139bc6a0f8881da1ed8389a065b3 /contrib/libs/liburing/test/accept.c
parenta83bd2dd3c21e38c6c0807ec5e679497ab567f24 (diff)
downloadydb-afd4899380eea1c70e2a68714b5da1c9919ccdbd.tar.gz
Update contrib/libs/liburing to 2.6
3b51a9fb14de805208d11f1c077c78bb5d487e0f
Diffstat (limited to 'contrib/libs/liburing/test/accept.c')
-rw-r--r--contrib/libs/liburing/test/accept.c23
1 files changed, 20 insertions, 3 deletions
diff --git a/contrib/libs/liburing/test/accept.c b/contrib/libs/liburing/test/accept.c
index df23eab53f..2208a54708 100644
--- a/contrib/libs/liburing/test/accept.c
+++ b/contrib/libs/liburing/test/accept.c
@@ -196,7 +196,8 @@ static int start_accept_listen(struct sockaddr_in *addr, int port_off,
addr->sin_family = AF_INET;
addr->sin_addr.s_addr = inet_addr("127.0.0.1");
- assert(!t_bind_ephemeral_port(fd, addr));
+ ret = t_bind_ephemeral_port(fd, addr);
+ assert(!ret);
ret = listen(fd, 128);
assert(ret != -1);
@@ -311,6 +312,9 @@ static int test_loop(struct io_uring *ring,
multishot ? "Multishot" : "",
i, s_fd[i]);
goto err;
+ } else if (s_fd[i] == 195 && args.overflow) {
+ fprintf(stderr, "Broken overflow handling\n");
+ goto err;
}
if (multishot && fixed) {
@@ -555,6 +559,9 @@ static int test_accept_cancel(unsigned usecs, unsigned int nr, bool multishot)
fprintf(stderr, "unexpected 0 user data\n");
goto err;
} else if (cqe->user_data <= nr) {
+ /* no multishot */
+ if (cqe->res == -EINVAL)
+ return T_EXIT_SKIP;
if (cqe->res != -EINTR && cqe->res != -ECANCELED) {
fprintf(stderr, "Cancelled accept got %d\n", cqe->res);
goto err;
@@ -679,7 +686,12 @@ static int test_accept_fixed(void)
ret = io_uring_queue_init(32, &m_io_uring, 0);
assert(ret >= 0);
ret = io_uring_register_files(&m_io_uring, &fd, 1);
- assert(ret == 0);
+ if (ret) {
+ /* kernel doesn't support sparse registered files, skip */
+ if (ret == -EBADF || ret == -EINVAL)
+ return T_EXIT_SKIP;
+ return T_EXIT_FAIL;
+ }
ret = test(&m_io_uring, args);
io_uring_queue_exit(&m_io_uring);
return ret;
@@ -701,7 +713,12 @@ static int test_multishot_fixed_accept(void)
ret = io_uring_queue_init(MAX_FDS + 10, &m_io_uring, 0);
assert(ret >= 0);
ret = io_uring_register_files(&m_io_uring, fd, MAX_FDS);
- assert(ret == 0);
+ if (ret) {
+ /* kernel doesn't support sparse registered files, skip */
+ if (ret == -EBADF || ret == -EINVAL)
+ return T_EXIT_SKIP;
+ return T_EXIT_FAIL;
+ }
ret = test(&m_io_uring, args);
io_uring_queue_exit(&m_io_uring);
return ret;