summaryrefslogtreecommitdiffstats
path: root/c/src/exec/libcsupport/src/seekdir.c
diff options
context:
space:
mode:
Diffstat (limited to 'c/src/exec/libcsupport/src/seekdir.c')
-rw-r--r--c/src/exec/libcsupport/src/seekdir.c27
1 files changed, 22 insertions, 5 deletions
diff --git a/c/src/exec/libcsupport/src/seekdir.c b/c/src/exec/libcsupport/src/seekdir.c
index e591adbb9f..80802b56c6 100644
--- a/c/src/exec/libcsupport/src/seekdir.c
+++ b/c/src/exec/libcsupport/src/seekdir.c
@@ -1,7 +1,14 @@
/*
* seekdir() - POSIX 1003.1b - XXX
*
- * $Id$
+ * 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.
+ *
*/
#include <sys/param.h>
@@ -12,10 +19,20 @@
#include <errno.h>
void seekdir(
- DIR *dirp,
- long loc
+ DIR *dirp,
+ long loc
)
{
- errno = ENOSYS;
- return -1;
+ off_t status;
+
+ status = lseek( dirp->dd_fd, loc, SEEK_SET );
+
+ /*
+ * This is not a nice way to error out, but we have no choice here.
+ */
+ if( status == -1 )
+ return;
+
+ dirp->dd_loc = 0;
+
}