Help finding/using sys/mman.h

User avatar
hex007
Posts: 3
Joined: Wed Jan 17, 2018 3:05 am

Help finding/using sys/mman.h

Postby hex007 » Tue Feb 06, 2018 9:51 pm

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
Sent from 20,000 leagues under the sea

ESP_Sprite
Posts: 9764
Joined: Thu Nov 26, 2015 4:08 am

Re: Help finding/using sys/mman.h

Postby ESP_Sprite » Wed Feb 07, 2018 3:03 am

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.

Who is online

Users browsing this forum: No registered users and 32 guests