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

Function io_uring_peek_batch_cqe

src/queue.c:227–241  ·  view source on GitHub ↗

* Fill in an array of IO completions up to count, if any are available. * Returns the amount of IO completions filled. */

Source from the content-addressed store, hash-verified

225 * Returns the amount of IO completions filled.
226 */
227unsigned io_uring_peek_batch_cqe(struct io_uring *ring,
228 struct io_uring_cqe **cqes, unsigned count)
229{
230 if (io_uring_peek_batch_cqe_(ring, cqes, &count))
231 return count;
232
233 if (!cq_ring_needs_flush(ring))
234 return 0;
235
236 io_uring_get_events(ring);
237 if (!io_uring_peek_batch_cqe_(ring, cqes, &count))
238 return 0;
239
240 return count;
241}
242
243/*
244 * Sync internal state with kernel ring state on the SQ side. Returns the

Callers 3

test_enobufFunction · 0.85
test_overflow_handlingFunction · 0.85
mainFunction · 0.85

Calls 3

io_uring_peek_batch_cqe_Function · 0.85
cq_ring_needs_flushFunction · 0.85
io_uring_get_eventsFunction · 0.85

Tested by 2

test_enobufFunction · 0.68
test_overflow_handlingFunction · 0.68