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

Function probe_support

test/vec-regbuf.c:34–63  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

32static int page_sz;
33
34static 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);
59out:
60 io_uring_queue_exit(&ring);
61 if (p)
62 free(p);
63}
64
65static void bind_ring(struct buf_desc *bd, struct io_uring *ring, unsigned buf_idx)
66{

Callers 1

mainFunction · 0.85

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