when grepping code, we can see that HAVE_SYS_MMAN_H and HAVE_MMAP are defined in config.h
meson.build also defines HAVE_MMAN_H wich is never used.
that is a lot for just one usage.
what about simplifying all this ? I would say just using HAVE_MMAP (which is detected by including sys/mmap.h in meson.build) to include sys/mman.h and for the usage of mmap, munmap, mremap and mprotect.
What do you think of this request ?