shm_open 和 mmap 之间的关系?
我已经阅读了许多shm_open
文档。所有 docs MMAP
。我没有明白为什么应该与mmap
一起使用? mmap
从shm_open
做什么?文档指出:
shm_open()类似于open()。
如果这是真的,那么为什么不能直接读/写入共享内存对象,就像带有open()
的常规文件一样。如果SHM_OPEN
和MMAP
应该始终一起使用,为什么他们不只是将它们合并到一个API中?
I have read many shm_open
docs. All of the docs are showing how it should be used with mmap
. I didn't get why it should be used with mmap
? What does mmap
do extra from shm_open
? The docs states:
shm_open() is analogous to that of open().
If this is true, then why can't I read/write directly to the shared memory object, just like regular files with open()
. If shm_open
and mmap
should always be used together, why they didn't just merge them into one API?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论