9 * This function fakes mmap() by reading `len' bytes from the file descriptor
10 * `fd' and returning a pointer to that memory. The "mapped" region can later
11 * be deallocated with munmap().
13 * Note: ONLY reading is supported and only reading of the exact size of the
16 * PUBLIC: #ifndef HAVE_MMAP
17 * PUBLIC: char *mmap __P((char *, size_t, int, int, int, off_t));
21 mmap(addr
, len
, prot
, flags
, fd
, off
)
29 if ((ptr
= (char *)malloc(len
)) == 0)
31 if (read(fd
, ptr
, len
) < 0) {
39 * PUBLIC: #ifndef HAVE_MMAP
40 * PUBLIC: int munmap __P((char *, size_t));