io\_uring\_cqe\_nr(3) liburing Manual io\_uring\_cqe\_nr(3)

# [NAME](#NAME)

io\_uring\_cqe\_nr - return the number of CQ ring slots consumed by a CQE

# [SYNOPSIS](#SYNOPSIS)

```
#include <liburing.h>
```

```
unsigned io_uring_cqe_nr(const struct io_uring_cqe *cqe);
```

# [DESCRIPTION](#DESCRIPTION)

The [**io\_uring\_cqe\_nr**(3)](/man/os/liburing/io_uring_cqe_nr.3) function returns the number of CQ ring slots consumed by *cqe*. For normal 16-byte CQEs, this returns 1. For 32-byte CQEs (when **IORING\_CQE\_F\_32** is set in the CQE flags), this returns 2.

This function is useful when advancing the CQ ring with [**io\_uring\_cq\_advance**(3)](/man/os/liburing/io_uring_cq_advance.3) on rings that use **IORING\_SETUP\_CQE\_MIXED** where both 16-byte and 32-byte CQEs may be present.

# [RETURN VALUE](#RETURN_VALUE)

Returns 1 for normal CQEs, or 2 for 32-byte CQEs.

# [SEE ALSO](#SEE_ALSO)

[**io\_uring\_cq\_advance**(3)](/man/os/liburing/io_uring_cq_advance.3), [**io\_uring\_cqe\_seen**(3)](/man/os/liburing/io_uring_cqe_seen.3), [**io\_uring\_setup**(2)](/man/os/liburing/io_uring_setup.2)

January 18, 2025 liburing-2.12

---

Document: io_uring_cqe_nr(3) from liburing 2.15-r5 (Chainguard OS)
Source: https://github.com/axboe/liburing.git
