io\_uring\_register\_restrictions(3) liburing Manual io\_uring\_register\_restrictions(3)

# [NAME](#NAME)

io\_uring\_register\_restrictions - register restrictions with io\_uring

# [SYNOPSIS](#SYNOPSIS)

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

```
int io_uring_register_restrictions(struct io_uring *ring,
                                   struct io_uring_restriction *res,
                                   unsigned int nr_res);
```

# [DESCRIPTION](#DESCRIPTION)

The [**io\_uring\_register\_restrictions**(3)](/man/os/liburing/io_uring_register_restrictions.3) function registers restrictions with the io\_uring instance specified by *ring*. The *res* argument is a pointer to an array of *struct io\_uring\_restriction* of *nr\_res* entries.

Restrictions allow limiting which opcodes, register operations, or SQE flags are allowed on a ring. This can be used to sandbox io\_uring usage.

Restrictions can only be registered if the io\_uring ring was started in a disabled state (with **IORING\_SETUP\_R\_DISABLED** specified in the call to [**io\_uring\_setup**(2)](/man/os/liburing/io_uring_setup.2)). All restrictions must be registered in a single call before enabling the ring with [**io\_uring\_enable\_rings**(3)](/man/os/liburing/io_uring_enable_rings.3).

See [**io\_uring\_register**(2)](/man/os/liburing/io_uring_register.2) for a description of the **IORING\_REGISTER\_RESTRICTIONS** operation and the restriction structure.

# [RETURN VALUE](#RETURN_VALUE)

Returns 0 on success. On error, a negative errno value is returned.

# [SEE ALSO](#SEE_ALSO)

[**io\_uring\_enable\_rings**(3)](/man/os/liburing/io_uring_enable_rings.3), [**io\_uring\_register**(2)](/man/os/liburing/io_uring_register.2), [**io\_uring\_setup**(2)](/man/os/liburing/io_uring_setup.2)

January 18, 2025 liburing-2.4

---

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