* this function is a POSIX compliant version, which will set position of * next directory structure in the directory stream. * * @param d the directory stream. * @param offset the offset in directory stream. */
| 832 | * @param offset the offset in directory stream. |
| 833 | */ |
| 834 | void seekdir(DIR *d, long offset) |
| 835 | { |
| 836 | struct dfs_file *fd; |
| 837 | |
| 838 | fd = fd_get(d->fd); |
| 839 | if (fd == NULL) |
| 840 | { |
| 841 | rt_set_errno(-EBADF); |
| 842 | |
| 843 | return ; |
| 844 | } |
| 845 | |
| 846 | /* seek to the offset position of directory */ |
| 847 | if (dfs_file_lseek(fd, offset) >= 0) |
| 848 | d->num = d->cur = 0; |
| 849 | } |
| 850 | RTM_EXPORT(seekdir); |
| 851 | |
| 852 | /** |
no test coverage detected