# io_uring: improve IO_Uring.copy_cqe · gitcafe/zig

[View on GitCafe](https://git.cafe/gitcafe/zig/commit/6630a5ede5ee2e31386aab59761660952cca2e0e)

Repository: [gitcafe/zig](https://git.cafe/gitcafe/zig)

Visibility: public

Requested revision: 6630a5ede5ee2e31386aab59761660952cca2e0e

Requested commit: 6630a5ede5ee2e31386aab59761660952cca2e0e

Commit: 6630a5ede5ee2e31386aab59761660952cca2e0e

Tree: ba1007ac4a5c6a043e0fec978d71ebf23b872df2

Author: Vincent Rischmann

Committer: Andrew Kelley

## Message

```
io_uring: improve IO_Uring.copy_cqe

copy_cqes() is not guaranteed to return as many CQEs as provided in the
`wait_nr` argument, meaning the assert in `copy_cqe` can trigger.

Instead, loop until we do get at least one CQE returned.

This mimics the behaviour of liburing's _io_uring_get_cqe.

```

## Parents

- [76fd6fc36505a203fba77e2103db12be59514532](https://git.cafe/gitcafe/zig/commit/76fd6fc36505a203fba77e2103db12be59514532?format=markdown)

[Source at this commit](https://git.cafe/gitcafe/zig/tree/6630a5ede5ee2e31386aab59761660952cca2e0e?format=markdown)
