Sharing memory between processes through the use of mmap()

前端 未结 3 2099
遇见更好的自我
遇见更好的自我 2020-12-05 10:43

I\'m in Linux 2.6. I have an environment where 2 processes simulate (using shared memory) the exchange of data through a simple implementation of the message passing mode.

3条回答
  •  眼角桃花
    2020-12-05 11:23

    Just for anyone reading this question in 2018 and later. The solution is now to use memfd_create to create an anonymous file and use a unix socket to pass this file handle to the other process.

    memfd_create is a linux only syscall

提交回复
热议问题