---
name: "io_uring_ring_dontfork"
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_ring_dontfork"
---

# io\_uring\_ring\_dontfork(3)

prevent ring memory from being shared after fork

## NAME

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

## SYNOPSIS

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

**int io\_uring\_ring\_dontfork(struct io\_uring \****ring***);**

## DESCRIPTION

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

This function uses [**madvise**(2)](/madvise/2.md) 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

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

## SEE ALSO

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