source: rtems/c/src/exec/libcsupport/src/seekdir.c @ 19b74f31

4.104.114.84.95
Last change on this file since 19b74f31 was 19b74f31, checked in by Joel Sherrill <joel.sherrill@…>, on 11/02/99 at 16:25:05

Check for NULL being passed in.

  • Property mode set to 100644
File size: 750 bytes
Line 
1/*
2 *  seekdir() - POSIX 1003.1b - XXX
3 *
4 *  COPYRIGHT (c) 1989-1998.
5 *  On-Line Applications Research Corporation (OAR).
6 *  Copyright assigned to U.S. Government, 1994.
7 *
8 *  The license and distribution terms for this file may be
9 *  found in the file LICENSE in this distribution or at
10 *  http://www.OARcorp.com/rtems/license.html.
11 *
12 */
13
14#include <sys/param.h>
15#include <assert.h>
16#include <dirent.h>
17#include <stdio.h>
18#include <unistd.h>
19#include <errno.h>
20
21void seekdir(
22   DIR  *dirp,
23   long  loc
24)
25{
26  off_t status;
27
28  if ( !dirp )
29    return;
30
31  status = lseek( dirp->dd_fd, loc, SEEK_SET );
32
33  /*
34   * This is not a nice way to error out, but we have no choice here.
35   */
36
37  if ( status == -1 )
38    return;
39
40  dirp->dd_loc = 0;
41}
Note: See TracBrowser for help on using the repository browser.