| 103 | } |
| 104 | |
| 105 | static int test_sqe_update(struct io_uring *ring) |
| 106 | { |
| 107 | struct io_uring_sqe *sqe; |
| 108 | struct io_uring_cqe *cqe; |
| 109 | int *fds, i, ret; |
| 110 | |
| 111 | fds = t_malloc(sizeof(int) * 10); |
| 112 | for (i = 0; i < 10; i++) |
| 113 | fds[i] = -1; |
| 114 | |
| 115 | sqe = io_uring_get_sqe(ring); |
| 116 | io_uring_prep_files_update(sqe, fds, 10, 0); |
| 117 | ret = io_uring_submit(ring); |
| 118 | if (ret != 1) { |
| 119 | fprintf(stderr, "submit: %d\n", ret); |
| 120 | return 1; |
| 121 | } |
| 122 | |
| 123 | ret = io_uring_wait_cqe(ring, &cqe); |
| 124 | if (ret) { |
| 125 | fprintf(stderr, "wait: %d\n", ret); |
| 126 | return 1; |
| 127 | } |
| 128 | |
| 129 | ret = cqe->res; |
| 130 | io_uring_cqe_seen(ring, cqe); |
| 131 | free(fds); |
| 132 | if (ret == -EINVAL) { |
| 133 | fprintf(stdout, "IORING_OP_FILES_UPDATE not supported, skipping\n"); |
| 134 | return T_EXIT_SKIP; |
| 135 | } |
| 136 | return ret != 10; |
| 137 | } |
| 138 | |
| 139 | static int test_update_no_table(void) |
| 140 | { |
no test coverage detected