我试图通过dlopen调用对动态加载的共享库中的特定地址空间进行写访问。这样做有什么限制吗?我知道它可以完成,因为可以使用gdb调试solib。 Gdb使用mprotect来获取对solib的写访问权以插入和清除断点。
作为返回,我得到-1作为返回,29作为错误编号,perror给出ENOMEM Cannot allocate memory
ENOMEM
The application has requested Single UNIX Specification, Version 2 compliant behavior, but addresses in the range are not valid for the address space of the process, or the addresses specify one or more pages that are not attached to the user's address space by a previous mmap or shmat subroutine call.