---
name: "io_uring_peek_cqe"
section: "3"
platform: "linux"
package: "liburing"
version: "2.15-1"
release: "Arch Linux 2026-11-01"
platforms: ["linux"]
url: "https://new.carta.tech/io_uring_peek_cqe"
---

# io\_uring\_peek\_cqe(3)

check if an io\_uring completion event is available

## NAME

io\_uring\_peek\_cqe - check if an io\_uring completion event is available

## SYNOPSIS

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

**int io\_uring\_peek\_cqe(struct io\_uring \****ring***,**                       **struct io\_uring\_cqe \*\****cqe\_ptr***);**

**unsigned io\_uring\_peek\_batch\_cqe(struct io\_uring \****ring***,**                                  **struct io\_uring\_cqe \*\****cqe\_ptrs***,**                                  **unsigned** *count***);**

## DESCRIPTION

The [**io\_uring\_peek\_cqe**(3)](/io_uring_peek_cqe/3.md) function returns an IO completion from the queue belonging to the *ring* param, if one is readily available. On successful return, *cqe\_ptr* param is filled with a valid CQE entry.

This function does not enter the kernel to wait for an event, an event is only returned if it's already available in the CQ ring.

The [**io\_uring\_peek\_batch\_cqe**(3)](/io_uring_peek_batch_cqe/3.md) function returns up to *count* request completions in *cqe\_ptrs* belonging to the *ring* param, if they are readily available. It will not enter the kernel, unless the CQ ring is in an overflow condition. Upon successful return, *cqe\_ptrs* are filled with the number of events indicated by the return value.

## RETURN VALUE

On success [**io\_uring\_peek\_cqe**(3)](/io_uring_peek_cqe/3.md) returns **0** and the cqe\_ptr parameter is filled in. On success [**io\_uring\_peek\_batch\_cqe**(3)](/io_uring_peek_batch_cqe/3.md) returns the number of completions filled in. On failure, [**io\_uring\_peek\_cqe**(3)](/io_uring_peek_cqe/3.md) may return **-EAGAIN**.

## SEE ALSO

[**io\_uring\_submit**(3)](/io_uring_submit/3.md), [**io\_uring\_wait\_cqes**(3)](/io_uring_wait_cqes/3.md), [**io\_uring\_wait\_cqe**(3)](/io_uring_wait_cqe/3.md)
