---
name: "io_uring_register_restrictions"
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_restrictions"
---

# io\_uring\_register\_restrictions(3)

register restrictions with io\_uring

## NAME

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

## SYNOPSIS

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

**int io\_uring\_register\_restrictions(struct io\_uring \****ring***,**                                    **struct io\_uring\_restriction \****res***,**                                    **unsigned int** *nr\_res***);**

## DESCRIPTION

The [**io\_uring\_register\_restrictions**(3)](/io_uring_register_restrictions/3.md) 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)](/io_uring_setup/2.md)). All restrictions must be registered in a single call before enabling the ring with [**io\_uring\_enable\_rings**(3)](/io_uring_enable_rings/3.md).

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

## RETURN VALUE

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

## SEE ALSO

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