Lines Matching refs:handle
82 HANDLE file_handle = CreateFile(path, win32_desired_access, win32_share,
95 mapfile_close(MapFile* handle)
98 if (CloseHandle(handle)) {
105 return close((int)(ptrdiff_t)handle);
110 mapfile_read(MapFile* handle, void* buf, size_t nbyte)
115 if (ReadFile(handle, buf, nbyte, &read_bytes, NULL)) {
125 ret = read((int)(ptrdiff_t)handle, buf, nbyte);
132 mapfile_read_at(MapFile* handle, size_t offset, void* buf, size_t nbyte)
137 if ((SetFilePointer(handle, convert.LowPart, &convert.HighPart,
143 return mapfile_read(handle, buf, nbyte);
145 ssize_t res = lseek((int)(ptrdiff_t)handle, offset, SEEK_SET);
146 return res >= 0 ? mapfile_read(handle, buf, nbyte) : res;
151 mapfile_map(MapFile* handle,
167 HANDLE map_handle;
210 map_handle = CreateFileMapping(handle, NULL, win32_prot,
226 mmap(0, map_size, PROT_READ, MAP_SHARED, (int)(ptrdiff_t)handle, map_offset);