* This function emulates mmap() by reading `len' bytes from the file
* descriptor `fd' and returning a pointer to that memory. The "mapped"
* region can later be deallocated with munmap().
* Note: ONLY reading is supported and only reading of the exact size
mmap_hack(addr
, len
, prot
, flags
, fd
, off
)
if ((ptr
= (char *)malloc(len
)) == 0)
if (read(fd
, ptr
, len
) < 0) {