io_uring_ring_dontfork(3) liburing Manual io_uring_ring_dontfork(3)

io_uring_ring_dontfork - prevent ring memory from being shared after fork

#include <liburing.h>
int io_uring_ring_dontfork(struct io_uring *ring);

The 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).

This function uses 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.

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

io_uring_queue_init(3), madvise(2), fork(2)

January 18, 2025 liburing-2.4