changed type of mem_size to unsigned long from mmap_t