Loading

mmap出现 Permission denied

Linux c中使用mmap出现Permission denied

出现create mmap error: Permission denied的原因是大部分的硬件设计都不支持在没有读取权限的情况下执行写操作。(或者你可以理解为mmap把文件的内容读到内存时隐含了一次读取操作)
所以在open中应该使用O_RDWR代替O_WRONLY

参考

https://stackoverflow.com/questions/33314745/in-c-mmap-the-file-for-write-permission-denied-linux

posted @ 2021-03-16 09:23  AD_milk  阅读(2187)  评论(0编辑  收藏  举报