io\_uring\_ring\_dontfork(3) liburing Manual io\_uring\_ring\_dontfork(3)

# [NAME](#NAME)

io\_uring\_ring\_dontfork - prevent ring memory from being shared after fork

# [SYNOPSIS](#SYNOPSIS)

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

```
int io_uring_ring_dontfork(struct io_uring *ring);
```

# [DESCRIPTION](#DESCRIPTION)

The [**io\_uring\_ring\_dontfork**(3)](/man/os/liburing/io_uring_ring_dontfork.3) function ensures that the mmap'ed rings for the io\_uring instance *ring* are not available to a child process after a [**fork**(2)](/man/os/liburing/fork.2).

This function uses [**madvise**(2)](/man/os/liburing/madvise.2) with **MADV\_DONTFORK** on the mmap'ed ranges to prevent them from being shared with child processes. This is useful when the parent wants exclusive access to the ring and doesn't want the child to be able to access or interfere with it.

# [RETURN VALUE](#RETURN_VALUE)

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

# [SEE ALSO](#SEE_ALSO)

[**io\_uring\_queue\_init**(3)](/man/os/liburing/io_uring_queue_init.3), [**madvise**(2)](/man/os/liburing/madvise.2), [**fork**(2)](/man/os/liburing/fork.2)

January 18, 2025 liburing-2.4

---

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