| 307 | } |
| 308 | |
| 309 | static int has_nonvec_read(void) |
| 310 | { |
| 311 | struct io_uring_probe *p; |
| 312 | struct io_uring ring; |
| 313 | int ret; |
| 314 | |
| 315 | ret = io_uring_queue_init(1, &ring, 0); |
| 316 | if (ret) { |
| 317 | fprintf(stderr, "queue init failed: %d\n", ret); |
| 318 | exit(ret); |
| 319 | } |
| 320 | |
| 321 | p = t_calloc(1, sizeof(*p) + 256 * sizeof(struct io_uring_probe_op)); |
| 322 | ret = io_uring_register_probe(&ring, p, 256); |
| 323 | /* if we don't have PROBE_REGISTER, we don't have OP_READ/WRITE */ |
| 324 | if (ret == -EINVAL) { |
| 325 | out: |
| 326 | io_uring_queue_exit(&ring); |
| 327 | free(p); |
| 328 | return 0; |
| 329 | } else if (ret) { |
| 330 | fprintf(stderr, "register_probe: %d\n", ret); |
| 331 | goto out; |
| 332 | } |
| 333 | |
| 334 | if (p->ops_len <= IORING_OP_READ) |
| 335 | goto out; |
| 336 | if (!(p->ops[IORING_OP_READ].flags & IO_URING_OP_SUPPORTED)) |
| 337 | goto out; |
| 338 | io_uring_queue_exit(&ring); |
| 339 | free(p); |
| 340 | return 1; |
| 341 | } |
| 342 | |
| 343 | static int test_eventfd_read(int flags) |
| 344 | { |
no test coverage detected