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

Subversion Repositories or1k

[/] [or1k/] [trunk/] [linux/] [uClibc/] [libc/] [misc/] [dirent/] [seekdir.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
void seekdir(DIR * dir, long int offset)
8
{
9
        if (!dir) {
10
                __set_errno(EBADF);
11
                return;
12
        }
13
#ifdef __UCLIBC_HAS_THREADS__
14
        __pthread_mutex_lock(&(dir->dd_lock));
15
#endif
16
        dir->dd_nextoff = lseek(dir->dd_fd, offset, SEEK_SET);
17
        dir->dd_size = dir->dd_nextloc = 0;
18
#ifdef __UCLIBC_HAS_THREADS__
19
        __pthread_mutex_unlock(&(dir->dd_lock));
20
#endif
21
}

powered by: WebSVN 2.1.0

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