mmap giving Permission Denied error
ravi2j at gmail.com
Sat Sep 21 10:04:01 EDT 2013
I have intentionally used MAP_FIXED flag as* *I am interested in mapping to
Even after setting the mmap_min_addr in /proc/sys/vm to 0 (which was
previously 4096), I am getting this error.
Is there anything wrong that I am doing?
On Sat, Sep 21, 2013 at 7:17 PM, ratheesh kannoth <ratheesh.ksz at gmail.com>wrote:
> MAP_FIXED could be trying to get a map from 0.
> Pls remove this flag and try.
> On Sat, Sep 21, 2013 at 6:55 PM, Ravi Teja <ravi2j at gmail.com> wrote:
>> Hello all,
>> I tried mmap'ing to address zero after setting *
>> /proc/sys/vm/mmap_min_addr* to* 0*, but mmap is giving Permission Denied
>> My C code is as below -
>> #include <stdio.h>
>> #include <stdlib.h>
>> #include <sys/mman.h>
>> int main(void)
>> int *ptr = NULL;
>> ptr =
>> if(ptr == MAP_FAILED)
>> perror("Error in mapping\n");
>> printf("After mmap\n");
>> *ptr = 16;
>> printf("Contents of address 0x%x is :: %d\n",ptr,*ptr);
>> return 0;
>> Am I doing anything wrong here?
>> Thank you in advance.
>> Ravi Teja
>> Kernelnewbies mailing list
>> Kernelnewbies at kernelnewbies.org
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Kernelnewbies