/* Return to the beginning of the directory "stream". We simply call findclose and then reset things like an opendir.  */
void _trewinddir(_TDIR *dirp)
/* Return to the beginning of the directory "stream". We simply call findclose and then reset things like an opendir.  */
void _trewinddir(_TDIR *dirp)
{
  errno = 0;
  if (!dirp)
    {
      errno = EFAULT;
      return;
    }
  if (dirp->dd_handle != -1)
    {
      _findclose (dirp->dd_handle);
    }
  dirp->dd_handle = -1;
  dirp->dd_stat = 0;
}