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

Function has_nonvec_read

test/fdinfo.c:309–341  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

307}
308
309static 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) {
325out:
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
343static int test_eventfd_read(int flags)
344{

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