# io_uring: improve IO_Uring.copy_cqe · gitcafe/zig

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

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

Visibility: public

Requested revision: 4d38f456ea70c350ca4530ecfa01931f2c8c4816

Requested commit: 4d38f456ea70c350ca4530ecfa01931f2c8c4816

Commit: 4d38f456ea70c350ca4530ecfa01931f2c8c4816

Tree: af17636dac00232dbbdc3c2619d925ad49d26113

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

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

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