| 370 | } |
| 371 | |
| 372 | static int has_nonvec_read(void) |
| 373 | { |
| 374 | struct io_uring_probe *p; |
| 375 | struct io_uring ring; |
| 376 | int ret; |
| 377 | |
| 378 | ret = io_uring_queue_init(1, &ring, 0); |
| 379 | if (ret) { |
| 380 | fprintf(stderr, "queue init failed: %d\n", ret); |
| 381 | exit(ret); |
| 382 | } |
| 383 | |
| 384 | p = t_calloc(1, sizeof(*p) + 256 * sizeof(struct io_uring_probe_op)); |
| 385 | ret = io_uring_register_probe(&ring, p, 256); |
| 386 | /* if we don't have PROBE_REGISTER, we don't have OP_READ/WRITE */ |
| 387 | if (ret == -EINVAL) { |
| 388 | out: |
| 389 | io_uring_queue_exit(&ring); |
| 390 | return 0; |
| 391 | } else if (ret) { |
| 392 | fprintf(stderr, "register_probe: %d\n", ret); |
| 393 | goto out; |
| 394 | } |
| 395 | |
| 396 | if (p->ops_len <= IORING_OP_READ) |
| 397 | goto out; |
| 398 | if (!(p->ops[IORING_OP_READ].flags & IO_URING_OP_SUPPORTED)) |
| 399 | goto out; |
| 400 | io_uring_queue_exit(&ring); |
| 401 | free(p); |
| 402 | return 1; |
| 403 | } |
| 404 | |
| 405 | static int test_eventfd_read(void) |
| 406 | { |
no test coverage detected