| 32 | static int page_sz; |
| 33 | |
| 34 | static void probe_support(void) |
| 35 | { |
| 36 | struct io_uring_probe *p; |
| 37 | struct io_uring ring; |
| 38 | int ret = 0; |
| 39 | |
| 40 | ret = io_uring_queue_init(1, &ring, 0); |
| 41 | if (ret) { |
| 42 | fprintf(stderr, "queue init failed: %d\n", ret); |
| 43 | exit(ret); |
| 44 | } |
| 45 | |
| 46 | p = t_calloc(1, sizeof(*p) + 256 * sizeof(struct io_uring_probe_op)); |
| 47 | ret = io_uring_register_probe(&ring, p, 256); |
| 48 | |
| 49 | /* if we don't have PROBE_REGISTER, we don't have OP_READ/WRITE */ |
| 50 | if (ret == -EINVAL) |
| 51 | goto out; |
| 52 | if (ret) { |
| 53 | fprintf(stderr, "register_probe: %d\n", ret); |
| 54 | goto out; |
| 55 | } |
| 56 | |
| 57 | has_regvec = p->ops_len > IORING_OP_READV_FIXED && |
| 58 | (p->ops[IORING_OP_READV_FIXED].flags & IO_URING_OP_SUPPORTED); |
| 59 | out: |
| 60 | io_uring_queue_exit(&ring); |
| 61 | if (p) |
| 62 | free(p); |
| 63 | } |
| 64 | |
| 65 | static void bind_ring(struct buf_desc *bd, struct io_uring *ring, unsigned buf_idx) |
| 66 | { |
no test coverage detected