summaryrefslogtreecommitdiffstats
path: root/cpukit/libfs/src/dosfs/msdos_init.c
diff options
context:
space:
mode:
authorSebastian Huber <sebastian.huber@embedded-brains.de>2014-10-20 09:33:34 +0200
committerSebastian Huber <sebastian.huber@embedded-brains.de>2014-10-23 10:21:25 +0200
commita7eaaae85b9b536b4d77c86e39c138d7c4f8f8fc (patch)
treee345db37897c534dd4885276695f8a7492af1a4d /cpukit/libfs/src/dosfs/msdos_init.c
parentbsp/stm32f4: Add header files (diff)
downloadrtems-a7eaaae85b9b536b4d77c86e39c138d7c4f8f8fc.tar.bz2
dosfs: Support ctime and mtime
Implement ctime and mtime updates according to POSIX. The ctime is mapped to the FAT create time and date. The mtime is mapped to the FAT last modified time and date. For the atime use the mtime for simplicity.
Diffstat (limited to 'cpukit/libfs/src/dosfs/msdos_init.c')
-rw-r--r--cpukit/libfs/src/dosfs/msdos_init.c18
1 files changed, 17 insertions, 1 deletions
diff --git a/cpukit/libfs/src/dosfs/msdos_init.c b/cpukit/libfs/src/dosfs/msdos_init.c
index 2846dbdeaf..08c8136bde 100644
--- a/cpukit/libfs/src/dosfs/msdos_init.c
+++ b/cpukit/libfs/src/dosfs/msdos_init.c
@@ -35,6 +35,22 @@ static int msdos_clone_node_info(rtems_filesystem_location_info_t *loc)
return fat_file_reopen(fat_fd);
}
+static int msdos_utime(
+ const rtems_filesystem_location_info_t *loc,
+ time_t actime,
+ time_t modtime
+)
+{
+ fat_file_fd_t *fat_fd = loc->node_access;
+
+ if (actime != modtime)
+ rtems_set_errno_and_return_minus_one( ENOTSUP );
+
+ fat_file_set_mtime(fat_fd, modtime);
+
+ return RC_OK;
+}
+
const rtems_filesystem_operations_table msdos_ops = {
.lock_h = msdos_lock,
.unlock_h = msdos_unlock,
@@ -52,7 +68,7 @@ const rtems_filesystem_operations_table msdos_ops = {
.fsmount_me_h = rtems_dosfs_initialize,
.unmount_h = rtems_filesystem_default_unmount,
.fsunmount_me_h = msdos_shut_down,
- .utime_h = rtems_filesystem_default_utime,
+ .utime_h = msdos_utime,
.symlink_h = rtems_filesystem_default_symlink,
.readlink_h = rtems_filesystem_default_readlink,
.rename_h = msdos_rename,