Example #1
0
void
rewinddir(DIR *dirp)
{
	_seekdir(dirp, dirp->dd_rewind);
	_reclaim_telldir(dirp);
	dirp->dd_rewind = telldir(dirp);
}
Example #2
0
/*
 * Seek to an entry in a directory.
 * _seekdir is in telldir.c so that it can share opaque data structures.
 */
void
seekdir(DIR *dirp, long loc)
{
    if (__isthreaded)
        _pthread_mutex_lock((pthread_mutex_t *)&dirp->dd_lock);
    _seekdir(dirp, loc);
    if (__isthreaded)
        _pthread_mutex_unlock((pthread_mutex_t *)&dirp->dd_lock);
}