added check for mmap() and comments