MCPcopy Create free account
hub / github.com/axboe/liburing / has_nonvec_read

Function has_nonvec_read

test/read-write.c:372–403  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

370}
371
372static 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) {
388out:
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
405static int test_eventfd_read(void)
406{

Callers 1

mainFunction · 0.70

Calls 4

io_uring_queue_initFunction · 0.85
t_callocFunction · 0.85
io_uring_register_probeFunction · 0.85
io_uring_queue_exitFunction · 0.85

Tested by

no test coverage detected