MCPcopy Create free account
hub / github.com/RT-Thread/rt-thread / dfs_win32_seek

Function dfs_win32_seek

bsp/simulator/drivers/dfs_win32.c:304–325  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

302}
303
304static int dfs_win32_seek(struct dfs_file *file,
305 rt_off_t offset)
306{
307 int result;
308
309 /* set offset as current offset */
310 if (file->vnode->type == FT_DIRECTORY)
311 {
312 WINDIR* wdirp = (WINDIR*)(file->vnode->data);
313 RT_ASSERT(wdirp != RT_NULL);
314 wdirp->curr = wdirp->start + offset;
315 return offset;
316 }
317 else //file->type == FT_REGULAR)
318 {
319 result = _lseek((int)(file->data), offset, SEEK_SET);
320 if (result >= 0)
321 return offset;
322 else
323 return win32_result_to_dfs(GetLastError());
324 }
325}
326
327/* return the size of struct dirent*/
328static int dfs_win32_getdents(struct dfs_file *file, struct dirent *dirp, rt_uint32_t count)

Callers

nothing calls this directly

Calls 2

win32_result_to_dfsFunction · 0.85
_lseekFunction · 0.50

Tested by

no test coverage detected