4.115
Last change
on this file since 9b4422a2 was
9b4422a2,
checked in by Joel Sherrill <joel.sherrill@…>, on 05/03/12 at 15:09:24
|
Remove All CVS Id Strings Possible Using a Script
Script does what is expected and tries to do it as
smartly as possible.
+ remove occurrences of two blank comment lines
next to each other after Id string line removed.
+ remove entire comment blocks which only exited to
contain CVS Ids
+ If the processing left a blank line at the top of
a file, it was removed.
|
-
Property mode set to
100644
|
File size:
1.3 KB
|
Line | |
---|
1 | /* |
---|
2 | * fstat() - POSIX 1003.1b 5.6.2 - Get File Status |
---|
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 | #if HAVE_CONFIG_H |
---|
13 | #include "config.h" |
---|
14 | #endif |
---|
15 | |
---|
16 | #include <sys/stat.h> |
---|
17 | #include <unistd.h> |
---|
18 | #include <string.h> |
---|
19 | |
---|
20 | #include <rtems/libio_.h> |
---|
21 | #include <rtems/seterr.h> |
---|
22 | |
---|
23 | int fstat( |
---|
24 | int fd, |
---|
25 | struct stat *sbuf |
---|
26 | ) |
---|
27 | { |
---|
28 | rtems_libio_t *iop; |
---|
29 | |
---|
30 | /* |
---|
31 | * Check to see if we were passed a valid pointer. |
---|
32 | */ |
---|
33 | if ( !sbuf ) |
---|
34 | rtems_set_errno_and_return_minus_one( EFAULT ); |
---|
35 | |
---|
36 | /* |
---|
37 | * Now process the stat() request. |
---|
38 | */ |
---|
39 | iop = rtems_libio_iop( fd ); |
---|
40 | rtems_libio_check_fd( fd ); |
---|
41 | rtems_libio_check_is_open(iop); |
---|
42 | |
---|
43 | /* |
---|
44 | * Zero out the stat structure so the various support |
---|
45 | * versions of stat don't have to. |
---|
46 | */ |
---|
47 | memset( sbuf, 0, sizeof(struct stat) ); |
---|
48 | |
---|
49 | return (*iop->pathinfo.handlers->fstat_h)( &iop->pathinfo, sbuf ); |
---|
50 | } |
---|
51 | |
---|
52 | /* |
---|
53 | * _fstat_r |
---|
54 | * |
---|
55 | * This is the Newlib dependent reentrant version of fstat(). |
---|
56 | */ |
---|
57 | |
---|
58 | #if defined(RTEMS_NEWLIB) && !defined(HAVE_FSTAT_R) |
---|
59 | |
---|
60 | #include <reent.h> |
---|
61 | |
---|
62 | int _fstat_r( |
---|
63 | struct _reent *ptr __attribute__((unused)), |
---|
64 | int fd, |
---|
65 | struct stat *buf |
---|
66 | ) |
---|
67 | { |
---|
68 | return fstat( fd, buf ); |
---|
69 | } |
---|
70 | #endif |
---|
Note: See
TracBrowser
for help on using the repository browser.