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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [rtos/] [rtems/] [c/] [src/] [lib/] [libc/] [seekdir.c] - Blame information for rev 846

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

Line No. Rev Author Line
1 30 unneback
/*
2
 *  seekdir() - POSIX 1003.1b - XXX
3
 *
4
 *  COPYRIGHT (c) 1989-1999.
5
 *  On-Line Applications Research Corporation (OAR).
6
 *
7
 *  The license and distribution terms for this file may be
8
 *  found in the file LICENSE in this distribution or at
9
 *  http://www.OARcorp.com/rtems/license.html.
10
 *
11
 */
12
 
13
#include <sys/param.h>
14
#include <assert.h>
15
#include <dirent.h>
16
#include <stdio.h>
17
#include <unistd.h>
18
#include <errno.h>
19
 
20
void seekdir(
21
   DIR  *dirp,
22
   long  loc
23
)
24
{
25
  off_t status;
26
 
27
  if ( !dirp )
28
    return;
29
 
30
  status = lseek( dirp->dd_fd, loc, SEEK_SET );
31
 
32
  /*
33
   * This is not a nice way to error out, but we have no choice here.
34
   */
35
 
36
  if ( status == -1 )
37
    return;
38
 
39
  dirp->dd_loc = 0;
40
}

powered by: WebSVN 2.1.0

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