summaryrefslogtreecommitdiff
path: root/cpukit/libfs/src/imfs/imfs_handlers_device.c
diff options
context:
space:
mode:
authorSebastian Huber <sebastian.huber@embedded-brains.de>2012-03-05 11:51:23 +0100
committerSebastian Huber <sebastian.huber@embedded-brains.de>2012-03-13 12:24:16 +0100
commite998c9851848691e98b1b1043d8d90c06215961b (patch)
tree63d021d81016111ac527541fda7a54f9e7d2d108 /cpukit/libfs/src/imfs/imfs_handlers_device.c
parent04ca77e31d6ac1f5b1cfa9da3b7ac5f8492d4171 (diff)
IMFS: Node specific stat handlers
Diffstat (limited to 'cpukit/libfs/src/imfs/imfs_handlers_device.c')
-rw-r--r--cpukit/libfs/src/imfs/imfs_handlers_device.c15
1 files changed, 14 insertions, 1 deletions
diff --git a/cpukit/libfs/src/imfs/imfs_handlers_device.c b/cpukit/libfs/src/imfs/imfs_handlers_device.c
index 625bc39884..dfbd8949c5 100644
--- a/cpukit/libfs/src/imfs/imfs_handlers_device.c
+++ b/cpukit/libfs/src/imfs/imfs_handlers_device.c
@@ -17,6 +17,19 @@
#include "imfs.h"
+static int IMFS_stat_device(
+ const rtems_filesystem_location_info_t *loc,
+ struct stat *buf
+)
+{
+ const IMFS_jnode_t *node = loc->node_access;
+ const IMFS_device_t *io = &node->info.device;
+
+ buf->st_rdev = rtems_filesystem_make_dev_t( io->major, io->minor );
+
+ return IMFS_stat( loc, buf );
+}
+
static const rtems_filesystem_file_handlers_r IMFS_device_handlers = {
device_open,
device_close,
@@ -24,7 +37,7 @@ static const rtems_filesystem_file_handlers_r IMFS_device_handlers = {
device_write,
device_ioctl,
device_lseek,
- IMFS_stat,
+ IMFS_stat_device,
device_ftruncate,
rtems_filesystem_default_fsync_or_fdatasync,
rtems_filesystem_default_fsync_or_fdatasync,