Skip to main content

alloc_shared

Function alloc_shared 

Source
pub fn alloc_shared(size: usize) -> Result<*mut u8, Error>
Expand description

Allocate shared memory visible across fork() boundaries.

Returns a pointer to size bytes of zeroed memory backed by MAP_SHARED | MAP_ANONYMOUS. The memory is readable and writable by both parent and child processes after fork().

ยงErrors

Returns an error if mmap fails (e.g., insufficient memory).