Sharing memory between two processes


I want to share memory between two processes. One way I know is to mmap a shared file. However, I don't want to use a shared file, I want an anonymous mapping in the memory. How can I do that.

shm_open is your friend. You can unmap the shared region by using shm_unlink.