| 302 | } |
| 303 | |
| 304 | static 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*/ |
| 328 | static int dfs_win32_getdents(struct dfs_file *file, struct dirent *dirp, rt_uint32_t count) |
nothing calls this directly
no test coverage detected