Lines Matching refs:file_map
61 static void *file_map; /* pointer of the mapped file */ variable
81 munmap(file_map, sb.st_size); in mmap_cleanup()
83 free(file_map); in mmap_cleanup()
84 file_map = NULL; in mmap_cleanup()
93 file_ptr = file_map + offset; in ulseek()
99 file_ptr = file_map + (sb.st_size - offset); in ulseek()
102 if (file_ptr < file_map) { in ulseek()
106 return file_ptr - file_map; in ulseek()
181 file_map = NULL; in mmap_file()
199 file_map = mmap(0, sb.st_size, PROT_READ|PROT_WRITE, MAP_PRIVATE, in mmap_file()
201 if (file_map == MAP_FAILED) { in mmap_file()
203 file_map = umalloc(sb.st_size); in mmap_file()
204 if (!file_map) { in mmap_file()
208 if (read(fd_map, file_map, sb.st_size) != sb.st_size) { in mmap_file()
210 free(file_map); in mmap_file()
211 file_map = NULL; in mmap_file()
220 file_end = file_map + sb.st_size; in mmap_file()
222 return file_map; in mmap_file()
349 n = write(fd_map, file_map, sb.st_size); in write_file()