| 52 | } |
| 53 | |
| 54 | static int submit_cmd_sqe(struct io_uring *ring, int32_t fd, |
| 55 | int op, int level, int optname, |
| 56 | void *optval, int optlen, |
| 57 | bool async) |
| 58 | { |
| 59 | struct io_uring_sqe *sqe; |
| 60 | int err; |
| 61 | |
| 62 | assert(fd > 0); |
| 63 | |
| 64 | sqe = io_uring_get_sqe(ring); |
| 65 | assert(sqe != NULL); |
| 66 | |
| 67 | io_uring_prep_cmd_sock(sqe, op, fd, level, optname, optval, optlen); |
| 68 | sqe->user_data = USERDATA; |
| 69 | if (async) |
| 70 | sqe->flags |= IOSQE_ASYNC; |
| 71 | |
| 72 | /* Submitting SQE */ |
| 73 | err = io_uring_submit_and_wait(ring, 1); |
| 74 | if (err != 1) |
| 75 | fprintf(stderr, "Failure: io_uring_submit_and_wait returned %d\n", err); |
| 76 | |
| 77 | return err; |
| 78 | } |
| 79 | |
| 80 | static int receive_cqe(struct io_uring *ring) |
| 81 | { |
no test coverage detected