I am trying to write access to a specific address space in a shared library that is loading dynamically with dlopen call. Are there any limitations to this? I know this can be done because solibs can be debugged with gdb. Gdb uses mprotect to write to solib to insert and clear breakpoints.
As a return, I get -1 as a return and 29 as an error number, perror gives 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 address space by a previous mmap or shmat subroutine call.
source
share