| 77 | } |
| 78 | |
| 79 | static void *queue_recv(struct io_uring *ring, int fd, bool fixed) |
| 80 | { |
| 81 | struct io_uring_sqe *sqe; |
| 82 | struct data *d; |
| 83 | |
| 84 | d = t_malloc(sizeof(*d)); |
| 85 | d->iov.iov_base = d->buf; |
| 86 | d->iov.iov_len = sizeof(d->buf); |
| 87 | |
| 88 | sqe = io_uring_get_sqe(ring); |
| 89 | io_uring_prep_readv(sqe, fd, &d->iov, 1, 0); |
| 90 | sqe->user_data = 2; |
| 91 | if (fixed) |
| 92 | sqe->flags |= IOSQE_FIXED_FILE; |
| 93 | |
| 94 | return d; |
| 95 | } |
| 96 | |
| 97 | static void queue_accept_multishot(struct io_uring *ring, int fd, |
| 98 | int idx, bool fixed) |