source: rtems/cpukit/libcsupport/src/rewinddir.c @ 98b785e

4.115
Last change on this file since 98b785e was 1749cef, checked in by Ralf Corsepius <ralf.corsepius@…>, on 12/05/08 at 06:44:40

Compile contents conditionally.

  • Property mode set to 100644
File size: 676 bytes
Line 
1/*
2 *  rewinddir() - POSIX 1003.1b - XXX
3 *
4 *  COPYRIGHT (c) 1989-1999.
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.rtems.com/license/LICENSE.
10 *
11 */
12
13#if HAVE_CONFIG_H
14#include "config.h"
15#endif
16
17#ifndef HAVE_REWINDDIR
18
19#include <sys/types.h>
20#include <assert.h>
21#include <dirent.h>
22#include <stdio.h>
23#include <errno.h>
24#include <unistd.h>
25
26void rewinddir(
27  DIR *dirp
28)
29{
30  off_t status;
31
32  if ( !dirp )
33    return;
34
35  status = lseek( dirp->dd_fd, 0, SEEK_SET );
36
37  if( status == -1 )
38    return;
39
40  dirp->dd_loc = 0;
41}
42
43#endif
Note: See TracBrowser for help on using the repository browser.