| 55 | }; |
| 56 | |
| 57 | static int arm_recv(struct io_uring *ring, struct recv_data *rd) |
| 58 | { |
| 59 | struct io_uring_sqe *sqe; |
| 60 | int ret; |
| 61 | |
| 62 | sqe = io_uring_get_sqe(ring); |
| 63 | io_uring_prep_recv_multishot(sqe, rd->accept_fd, NULL, 0, 0); |
| 64 | if (rd->recv_bundle && use_tcp) |
| 65 | sqe->ioprio |= IORING_RECVSEND_BUNDLE; |
| 66 | sqe->buf_group = RECV_BGID; |
| 67 | sqe->flags |= IOSQE_BUFFER_SELECT; |
| 68 | sqe->user_data = 2; |
| 69 | |
| 70 | ret = io_uring_submit(ring); |
| 71 | if (ret != 1) { |
| 72 | fprintf(stderr, "submit failed: %d\n", ret); |
| 73 | return 1; |
| 74 | } |
| 75 | |
| 76 | return 0; |
| 77 | } |
| 78 | |
| 79 | static int recv_prep(struct io_uring *ring, struct recv_data *rd, int *sock) |
| 80 | { |
no test coverage detected