/* this function is a POSIX compliant version, which will reset directory stream. */
void rewinddir(DIR *d)
/* this function is a POSIX compliant version, which will reset directory stream. */
void rewinddir(DIR *d)
{
    struct dfs_fd *fd;
    fd = fd_get(d->fd);
    if (fd == NULL)
    {
        rt_set_errno(-EBADF);
        return ;
    }
    if (dfs_file_lseek(fd, 0) >= 0)
        d->num = d->cur = 0;
    fd_put(fd);
}