VirtualProtectEx 的 Linux 等效项?

发布于 2024-09-25 15:46:47 字数 206 浏览 0 评论 0原文

我正在做一些简单的 JITing,并使用 VirtualProtectEx 在 Windows 下将页面标记为可执行文件。 在 Linux 下,最好是在其他类似 POSIX/Unix 的操作系统下,相当于什么?

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?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

我早已燃尽 2024-10-02 15:46:47

您正在寻找 mprotect 并且可能也在寻找 mmap。请注意,与 Windows 不同,进程 A 无法更改进程 B 的内存映射(缺少 ptrace)。

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).

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文