---
name: "io_uring_free_buf_ring"
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_free_buf_ring"
---

# io\_uring\_free\_buf\_ring(3)

register and free a buffer ring for provided buffers

## NAME

io\_uring\_free\_buf\_ring - register and free a buffer ring for provided buffers

## SYNOPSIS

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

**int io\_uring\_free\_buf\_ring(struct io\_uring \****ring***,**                            **struct io\_uring\_buf\_ring \****br***,**                            **unsigned int** *nentries***,**                            **int** *bgid***);**

## DESCRIPTION

The [**io\_uring\_free\_buf\_ring**(3)](/io_uring_free_buf_ring/3.md) function unregisters a previously registered shared buffer ring. The ring must have heen previously returned from [**io\_uring\_setup\_buf\_ring**(3)](/io_uring_setup_buf_ring/3.md)**.**

The *ring* argument must pointer to the ring for which the provided buffer ring is being registered, *br* must point to a buffer ring previously returned by [**io\_uring\_setup\_buf\_ring**(3)](/io_uring_setup_buf_ring/3.md)**,** *nentries* is the number of entries requested in the buffer ring, and *bgid* is the buffer group ID that *br* was setup with.

Under the covers, this function uses [**io\_uring\_unregister\_buf\_ring**(3)](/io_uring_unregister_buf_ring/3.md) to unregister the ring, and handles the freeing of the ring rather than letting the application open code it.

Available since 5.19.

## RETURN VALUE

On success [**io\_uring\_free\_buf\_ring**(3)](/io_uring_free_buf_ring/3.md) returns zero. On failure it returns **-errno**.

## SEE ALSO

[**io\_uring\_setup\_buf\_ring**(3)](/io_uring_setup_buf_ring/3.md)
