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

Function probe_zc_support

test/send-zerocopy.c:79–105  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

77static bool no_send_vec;
78
79static int probe_zc_support(void)
80{
81 struct io_uring ring;
82 struct io_uring_probe *p;
83 int ret;
84
85 has_sendzc = has_sendmsg = false;
86
87 ret = io_uring_queue_init(1, &ring, 0);
88 if (ret)
89 return -1;
90
91 p = t_calloc(1, sizeof(*p) + 256 * sizeof(struct io_uring_probe_op));
92 if (!p)
93 return -1;
94
95 ret = io_uring_register_probe(&ring, p, 256);
96 if (ret)
97 return -1;
98
99 has_sendzc = p->ops_len > IORING_OP_SEND_ZC;
100 has_sendmsg = p->ops_len > IORING_OP_SENDMSG_ZC;
101 has_regvec = p->ops_len > IORING_OP_READV_FIXED;
102 io_uring_queue_exit(&ring);
103 free(p);
104 return 0;
105}
106
107static bool check_cq_empty(struct io_uring *ring)
108{

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