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