summaryrefslogtreecommitdiffstats
path: root/c/src/lib/libc/rewinddir.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/rewinddir.c
parentAdded missing BSPs. (diff)
downloadrtems-928395ea568e2d4814ef017fca68ae5dc772a458.tar.bz2
New files.
Diffstat (limited to 'c/src/lib/libc/rewinddir.c')
-rw-r--r--c/src/lib/libc/rewinddir.c38
1 files changed, 38 insertions, 0 deletions
diff --git a/c/src/lib/libc/rewinddir.c b/c/src/lib/libc/rewinddir.c
new file mode 100644
index 0000000000..f480abf0f0
--- /dev/null
+++ b/c/src/lib/libc/rewinddir.c
@@ -0,0 +1,38 @@
+/*
+ * rewinddir() - POSIX 1003.1b - 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/types.h>
+#include <assert.h>
+#include <dirent.h>
+#include <stdio.h>
+#include <errno.h>
+#include <unistd.h>
+
+void rewinddir(
+ DIR *dirp
+)
+{
+ off_t status;
+
+ status = lseek( dirp->dd_fd, 0, SEEK_SET );
+
+ if( status == -1 ) {
+ printf("REWINDDIR: errno: %d\n", errno );
+ assert(0);
+ }
+
+ dirp->dd_loc = 0;
+
+
+}