OpenCores
URL https://opencores.org/ocsvn/or1k/or1k/trunk

Subversion Repositories or1k

[/] [or1k/] [trunk/] [linux/] [uClibc/] [libc/] [misc/] [dirent/] [rewinddir.c] - Blame information for rev 1325

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 1325 phoenix
#include <dirent.h>
2
#include <errno.h>
3
#include <unistd.h>
4
#include "dirstream.h"
5
 
6
 
7
/* rewinddir() just does an lseek(fd,0,0) - see close for comments */
8
void rewinddir(DIR * dir)
9
{
10
        if (!dir) {
11
                __set_errno(EBADF);
12
                return;
13
        }
14
#ifdef __UCLIBC_HAS_THREADS__
15
        __pthread_mutex_lock(&(dir->dd_lock));
16
#endif
17
        lseek(dir->dd_fd, 0, SEEK_SET);
18
        dir->dd_nextoff = dir->dd_nextloc = dir->dd_size = 0;
19
#ifdef __UCLIBC_HAS_THREADS__
20
        __pthread_mutex_unlock(&(dir->dd_lock));
21
#endif
22
}

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.