source:
rtems/c/src/exec/libcsupport/src/telldir.c
@
08311cc3
Last change on this file since 08311cc3 was 08311cc3, checked in by Joel Sherrill <joel.sherrill@…>, on 11/17/99 at 17:51:34 | |
---|---|
|
|
File size: 755 bytes |
Rev | Line | |
---|---|---|
[928395e] | 1 | /* |
2 | * telldir() - XXX | |
3 | * | |
[08311cc3] | 4 | * COPYRIGHT (c) 1989-1999. |
[07a3253d] | 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 | * | |
[928395e] | 11 | */ |
12 | ||
13 | #include <sys/param.h> | |
14 | #include <assert.h> | |
15 | #include <dirent.h> | |
16 | #include <stdlib.h> | |
17 | #include <unistd.h> | |
[19b74f31] | 18 | #include <errno.h> |
[928395e] | 19 | |
[07a3253d] | 20 | #include "libio_.h" |
21 | ||
[0cd2bd96] | 22 | |
[928395e] | 23 | long telldir( |
24 | DIR *dirp | |
25 | ) | |
26 | { | |
[07a3253d] | 27 | rtems_libio_t *iop; |
28 | ||
[19b74f31] | 29 | if ( !dirp ) |
30 | set_errno_and_return_minus_one( EBADF ); | |
31 | ||
[07a3253d] | 32 | /* |
[19b74f31] | 33 | * Get the file control block structure associated with the |
34 | * file descriptor | |
[07a3253d] | 35 | */ |
36 | ||
37 | iop = rtems_libio_iop( dirp->dd_fd ); | |
38 | ||
39 | if (iop == NULL) | |
40 | assert(0); | |
41 | ||
42 | return (long)( iop->offset ); | |
[928395e] | 43 | } |
Note: See TracBrowser
for help on using the repository browser.