Page 1 of 1

Help finding/using sys/mman.h

Posted: Tue Feb 06, 2018 9:51 pm
by hex007
I am porting some software to esp32 and I have run into a bit of a snag. There is a small memory that is mapped using mmap. I am getting an error that "sys/mman.h" cannot be found. How do i resolve this?

I found mman.h and .c in newlib repo. Can someone brief me what the newlib is?

Thanks

Re: Help finding/using sys/mman.h

Posted: Wed Feb 07, 2018 3:03 am
by ESP_Sprite
No such thing for the ESP32 as is, sorry. Mmap assumes that there is a MMu in the system that can pagefault when some address is accessed and then lazily load the data from whatever filesystem the file is on; as the ESP32 does not have a MMU that is capable of doing this, we do not have an equivalent for the mmap call. The closest you can get is esp_partition_mmap, which you can use to map a piece of flash (and only from flash) into memory.

Also, newlib is the C library we use, sort-of equivalent to glibc under Linux.