This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: dynamically written code problem


the mprotect man-page says:

" POSIX.1b says  that  mprotect  can  be  used  only on regions of memory
obtained from mmap(2)."

is there a way to set the PROT_EXEC flag on arbitrary malloc'ed space ? at
least, using mprotect is (currently) not POSIX conforming.

That code was explicitly for Linux, where there is no difference (at least in this respect) between sbrk- and mmap-allocated VMAs (virtual memory areas).


Paolo


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]