Can memory map be used for an already allocated memory buffer?

302 Views Asked by At

I'd like to be able to share a pre-allocated memory between processes.

Searching for an example to do it, I can only find a way to create a new file with shm_open, then use mmap and memcpy. This is a problem since the buffers are quite large and I don't control their allocation (API of a camera).

Is there a way to take an existing, pre allocated buffer, and share its content with another process, without memcpy, using mmap? or using another method other than mmap?

0

There are 0 best solutions below