Linux equivalent for VirtualProtectEx?

断了今生、忘了曾经 提交于 2019-12-12 02:45:40

问题


I am doing some simple JITing, and use VirtualProtectEx under Windows to mark pages as executable. What would be the equivalent of that under Linux, and preferably, other POSIX/Unix-like OSes too?


回答1:


You are looking for mprotect and probably also mmap. Note that, unlike with Windows, there is no way for process A to change process B's memory map (short of horrible tricks with ptrace).



来源:https://stackoverflow.com/questions/3800762/linux-equivalent-for-virtualprotectex

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!