There is already a bit of mess with mmap() functionality code. Need to be split in several different implementations.