2 * Sherlock Library -- Mapping of Files
4 * (c) 1999 Martin Mares <mj@ucw.cz>
16 mmap_file(byte *name, unsigned *len, int writeable)
18 int fd = open(name, writeable ? O_RDWR : O_RDONLY);
24 if (fstat(fd, &st) < 0)
32 x = mmap(NULL, st.st_size, writeable ? (PROT_READ | PROT_WRITE) : PROT_READ, MAP_SHARED, fd, 0);
36 else /* For empty file, we can return any non-zero address */
44 munmap_file(void *start, unsigned len)