/* 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)
{
    if (d && d->fd > 0)
    {
        if (dfs_file_lseek(fd_get(d->fd), 0, SEEK_SET) >= 0)
            d->num = d->cur = 0;
    }
}