Roger Maclean
|
Re: Changing the access rigths of address space created by mmap()
|
Roger Maclean
10/17/2018 8:56 AM
post119220
|
Re: Changing the access rigths of address space created by mmap()
While you can't change the access rights for anything less than a page you may well want to change the rights to a much
larger amount of memory, hence the len parameter.
This isn't by the way a limitation of QNX itself, all OSes have similar restrictions since it's the way hardware works.
This is more or less what a page is, a range of memory that has some common characteristics. Doesn't have to be 4k,
can be more and can be less but still something that is done at the hardware level. To allow different memory to have
different access rights, the access rights have to be stored somewhere; memory has to be devoted to it. While a
processor could allow just what you’re after, the overhead in memory and time would be enormous. So it’s a trade-off
between better granularity and more efficient memory usage.
On 2018-10-17, 2:05 AM, "Sri Harsha Koribille" <community-noreply@qnx.com> wrote:
Hi David,
I'm using QNX 7.0
After using mprotect(), it is changing the access rights of other pointers in the address space too( as mentioned in
your answer).
If thats the case, in "int mprotect( void * addr, size_t len,int prot )", what is the significance of "len"
parameter
Is it possible to change the access rights of just a single pointer and not the entire CPU page?
_______________________________________________
OSTech
http://community.qnx.com/sf/go/post119219
To cancel your subscription to this discussion, please e-mail ostech-core_os-unsubscribe@community.qnx.com
|
|
|