4.104.114.84.95
Line | |
---|
1 | /* |
---|
2 | * seekdir() - 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.OARcorp.com/rtems/license.html. |
---|
10 | * |
---|
11 | */ |
---|
12 | |
---|
13 | #include <sys/param.h> |
---|
14 | #include <assert.h> |
---|
15 | #include <dirent.h> |
---|
16 | #include <stdio.h> |
---|
17 | #include <unistd.h> |
---|
18 | #include <errno.h> |
---|
19 | |
---|
20 | void seekdir( |
---|
21 | DIR *dirp, |
---|
22 | long loc |
---|
23 | ) |
---|
24 | { |
---|
25 | off_t status; |
---|
26 | |
---|
27 | if ( !dirp ) |
---|
28 | return; |
---|
29 | |
---|
30 | status = lseek( dirp->dd_fd, loc, SEEK_SET ); |
---|
31 | |
---|
32 | /* |
---|
33 | * This is not a nice way to error out, but we have no choice here. |
---|
34 | */ |
---|
35 | |
---|
36 | if ( status == -1 ) |
---|
37 | return; |
---|
38 | |
---|
39 | dirp->dd_loc = 0; |
---|
40 | } |
---|
Note: See
TracBrowser
for help on using the repository browser.