| 38 | } |
| 39 | |
| 40 | static int submit_and_wait(struct io_uring *ring, int *res) |
| 41 | { |
| 42 | struct io_uring_cqe *cqe; |
| 43 | int ret; |
| 44 | |
| 45 | ret = io_uring_submit_and_wait(ring, 1); |
| 46 | if (ret != 1) { |
| 47 | fprintf(stderr, "io_using_submit: got %d\n", ret); |
| 48 | return 1; |
| 49 | } |
| 50 | |
| 51 | ret = io_uring_peek_cqe(ring, &cqe); |
| 52 | if (ret) { |
| 53 | fprintf(stderr, "io_uring_peek_cqe(): no cqe returned"); |
| 54 | return 1; |
| 55 | } |
| 56 | |
| 57 | *res = cqe->res; |
| 58 | io_uring_cqe_seen(ring, cqe); |
| 59 | return 0; |
| 60 | } |
| 61 | |
| 62 | static int wait_for(struct io_uring *ring, int fd, int mask) |
| 63 | { |
no test coverage detected