diff options
Diffstat (limited to 'c/src/lib/libc/rewinddir.c')
-rw-r--r-- | c/src/lib/libc/rewinddir.c | 38 |
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; + + +} |