source:
rtems/cpukit/libfs/src/devfs/devstat.c
@
c499856
Last change on this file since c499856 was c499856, checked in by Chris Johns <chrisj@…>, on 03/20/14 at 21:10:47 | |
---|---|
|
|
File size: 725 bytes |
Rev | Line | |
---|---|---|
[d883ce2] | 1 | /** |
2 | * @file | |
3 | * | |
4 | * @brief Gets the Device File Information | |
5 | * @ingroup DevFsDeviceTable Define Device Table Type | |
6 | */ | |
7 | ||
[d40da79b] | 8 | /* |
9 | * The license and distribution terms for this file may be | |
10 | * found in the file LICENSE in this distribution or at | |
[c499856] | 11 | * http://www.rtems.org/license/LICENSE. |
[d40da79b] | 12 | */ |
13 | ||
14 | #if HAVE_CONFIG_H | |
[3b7c123] | 15 | #include "config.h" |
[d40da79b] | 16 | #endif |
17 | ||
18 | #include "devfs.h" | |
19 | ||
20 | int devFS_stat( | |
[3b7c123] | 21 | const rtems_filesystem_location_info_t *loc, |
22 | struct stat *buf | |
[d40da79b] | 23 | ) |
24 | { | |
[3b7c123] | 25 | int rv = 0; |
26 | const devFS_node *the_dev = loc->node_access; | |
[d40da79b] | 27 | |
[3b7c123] | 28 | if (the_dev != NULL) { |
29 | buf->st_rdev = rtems_filesystem_make_dev_t( the_dev->major, the_dev->minor ); | |
30 | buf->st_mode = the_dev->mode; | |
31 | } else { | |
32 | rv = rtems_filesystem_default_fstat(loc, buf); | |
33 | } | |
[d40da79b] | 34 | |
[3b7c123] | 35 | return rv; |
[d40da79b] | 36 | } |
Note: See TracBrowser
for help on using the repository browser.