If I understand correctly, if MAP_FIXED is not specified, the behavior of mmap is implementation dependent. Thus, the only portable way to use mmap is with MAP_FIXED, which means you have to specify a page-aligned address. Otherwise, you will receive EINVAL.
source
share