summaryrefslogtreecommitdiffstats
path: root/c/src/lib/libc/telldir.c
diff options
context:
space:
mode:
authorJoel Sherrill <joel.sherrill@OARcorp.com>1998-10-13 16:07:38 +0000
committerJoel Sherrill <joel.sherrill@OARcorp.com>1998-10-13 16:07:38 +0000
commit928395ea568e2d4814ef017fca68ae5dc772a458 (patch)
tree96e2a7f516b92a854d4590e817653f4dfeac743f /c/src/lib/libc/telldir.c
parentAdded missing BSPs. (diff)
downloadrtems-928395ea568e2d4814ef017fca68ae5dc772a458.tar.bz2
New files.
Diffstat (limited to 'c/src/lib/libc/telldir.c')
-rw-r--r--c/src/lib/libc/telldir.c40
1 files changed, 40 insertions, 0 deletions
diff --git a/c/src/lib/libc/telldir.c b/c/src/lib/libc/telldir.c
new file mode 100644
index 0000000000..9825f04939
--- /dev/null
+++ b/c/src/lib/libc/telldir.c
@@ -0,0 +1,40 @@
+/*
+ * telldir() - XXX
+ *
+ * COPYRIGHT (c) 1989-1998.
+ * On-Line Applications Research Corporation (OAR).
+ * Copyright assigned to U.S. Government, 1994.
+ *
+ * The license and distribution terms for this file may be
+ * found in the file LICENSE in this distribution or at
+ * http://www.OARcorp.com/rtems/license.html.
+ *
+ * $Id$
+ */
+
+#include <sys/param.h>
+#include <assert.h>
+#include <dirent.h>
+#include <stdlib.h>
+#include <unistd.h>
+
+#include "libio_.h"
+
+
+long telldir(
+ DIR *dirp
+)
+{
+ rtems_libio_t *iop;
+
+ /*
+ * Get the file control block structure associated with the file descriptor
+ */
+
+ iop = rtems_libio_iop( dirp->dd_fd );
+
+ if (iop == NULL)
+ assert(0);
+
+ return (long)( iop->offset );
+}