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

Subversion Repositories or1k

[/] [or1k/] [trunk/] [rtems-20020807/] [cpukit/] [libcsupport/] [src/] [telldir.c] - Blame information for rev 1765

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 1026 ivang
/*
2
 *  telldir() - 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
#if HAVE_CONFIG_H
14
#include "config.h"
15
#endif
16
 
17
#include <sys/param.h>
18
#include <assert.h>
19
#include <dirent.h>
20
#include <stdlib.h>
21
#include <unistd.h>
22
#include <errno.h>
23
 
24
#include <rtems/libio_.h>
25
#include <rtems/seterr.h>
26
 
27
long telldir(
28
  DIR *dirp
29
)
30
{
31
  rtems_libio_t  *iop;
32
 
33
  if ( !dirp )
34
    rtems_set_errno_and_return_minus_one( EBADF );
35
 
36
  /*
37
   *  Get the file control block structure associated with the
38
   *  file descriptor
39
   */
40
 
41
  iop = rtems_libio_iop( dirp->dd_fd );
42
 
43
  if (iop == NULL)
44
     assert(0);
45
 
46
  return (long)( iop->offset );
47
}

powered by: WebSVN 2.1.0

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