---
name: "io_uring_register_region"
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_register_region"
---

# io\_uring\_register\_region(3)

register a memory region

## NAME

io\_uring\_register\_region - register a memory region

## SYNOPSIS

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

**int io\_uring\_register\_region(struct io\_uring \****ring***,**                              **struct io\_uring\_mem\_region\_reg \****reg***);**

## DESCRIPTION

The [**io\_uring\_register\_region**(3)](/io_uring_register_region/3.md) function registers a memory region to io\_uring. Upon successful completion, the memory region may then be used, for example, to pass waiting parameters to the [**io\_uring\_enter**(2)](/io_uring_enter/2.md) system call in a more efficient manner as it avoids copying wait related data for each wait event. The *ring* argument should point to the ring in question, and the *reg* argument should be a pointer to a **struct io\_uring\_mem\_region\_reg .**

The *reg* argument must be filled in with the appropriate information. It looks as follows:

```
struct io_uring_mem_region_reg {
    __u64 region_uptr;
    __u64 flags;
    __u64 __resv[2];
};
```

The *region\_uptr* field must contain a pointer to an appropriately filled **struct io\_uring\_region\_desc.**

The *flags* field must contain a bitmask of the following values:

- **IORING\_MEM\_REGION\_REG\_WAIT\_ARG**

  allows use of the region to pass waiting parameters to the [**io\_uring\_enter**(2)](/io_uring_enter/2.md) system call. If set, the registration is only allowed while the ring is in a disabled mode. See **IORING\_SETUP\_R\_DISABLED.**

The \_\_resv fields must be filled with zeroes.

**struct io\_uring\_region\_desc** is defined as following:

```
struct io_uring_region_desc {
    __u64 user_addr;
    __u64 size;
    __u32 flags;
    __u32 id;
    __u64 mmap_offset;
    __u64 __resv[4];
};
```

The *user\_addr* field must contain a pointer to the memory the user wants to register. It's valid only if **IORING\_MEM\_REGION\_TYPE\_USER** is set, and should be zero otherwise.

The *size* field should contain the size of the region.

The *flags* field must contain a bitmask of the following values:

- **IORING\_MEM\_REGION\_TYPE\_USER**

  tells the kernel to use memory specified by the *user\_addr* field. If not set, the kernel will allocate memory for the region, which can then be mapped into the user space.

On successful registration of a region with kernel provided memory, the *mmap\_offset* field will contain an offset that can be passed to the **[mmap(2)](/mmap/2.md)** system call to map the region into the user space.

The *id* field is reserved and must be set to zero.

The *\_\_resv* fields must be filled with zeroes.

Available since kernel 6.13.

## RETURN VALUE

On success [**io\_uring\_register\_region**(3)](/io_uring_register_region/3.md) returns 0. On failure it returns **-errno**.
