source: rtems/c/src/lib/libc/telldir.c @ 23e3ce64

4.104.114.84.95
Last change on this file since 23e3ce64 was 08311cc3, checked in by Joel Sherrill <joel.sherrill@…>, on 11/17/99 at 17:51:34

Updated copyright notice.

  • Property mode set to 100644
File size: 755 bytes
Line 
1/*
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#include <sys/param.h>
14#include <assert.h>
15#include <dirent.h>
16#include <stdlib.h>
17#include <unistd.h>
18#include <errno.h>
19
20#include "libio_.h"
21
22
23long telldir(
24  DIR *dirp
25)
26{
27  rtems_libio_t  *iop;
28
29  if ( !dirp )
30    set_errno_and_return_minus_one( EBADF );
31
32  /*
33   *  Get the file control block structure associated with the
34   *  file descriptor
35   */
36
37  iop = rtems_libio_iop( dirp->dd_fd );
38
39  if (iop == NULL)
40     assert(0);
41
42  return (long)( iop->offset );
43}
Note: See TracBrowser for help on using the repository browser.