Skip to main content

io_uring_ring_dontfork

Function io_uring_ring_dontfork 

Source
pub unsafe extern "C" fn io_uring_ring_dontfork(
    ring: *mut io_uring,
) -> c_int
Expand description

Prevent ring memory from being shared after fork

§DESCRIPTION

The io_uring_ring_dontfork function ensures that the mmap’ed rings for the io_uring instance ring are not available to a child process after a fork.

This function uses madvise 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, madvise, fork