Lines Matching refs:file_map
53 static void *file_map; /* pointer of the mapped file */ variable
73 munmap(file_map, sb.st_size); in mmap_cleanup()
75 free(file_map); in mmap_cleanup()
76 file_map = NULL; in mmap_cleanup()
85 file_ptr = file_map + offset; in ulseek()
91 file_ptr = file_map + (sb.st_size - offset); in ulseek()
94 if (file_ptr < file_map) { in ulseek()
98 return file_ptr - file_map; in ulseek()
169 file_map = NULL; in mmap_file()
187 file_map = mmap(0, sb.st_size, PROT_READ|PROT_WRITE, MAP_PRIVATE, in mmap_file()
189 if (file_map == MAP_FAILED) { in mmap_file()
191 file_map = umalloc(sb.st_size); in mmap_file()
192 if (!file_map) { in mmap_file()
196 if (read(fd_map, file_map, sb.st_size) != sb.st_size) { in mmap_file()
198 free(file_map); in mmap_file()
199 file_map = NULL; in mmap_file()
208 file_end = file_map + sb.st_size; in mmap_file()
210 return file_map; in mmap_file()
337 n = write(fd_map, file_map, sb.st_size); in write_file()