diff options
author | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2014-10-20 09:33:34 +0200 |
---|---|---|
committer | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2014-10-23 10:21:25 +0200 |
commit | a7eaaae85b9b536b4d77c86e39c138d7c4f8f8fc (patch) | |
tree | e345db37897c534dd4885276695f8a7492af1a4d /cpukit/libfs/src/dosfs/fat_file.h | |
parent | bsp/stm32f4: Add header files (diff) | |
download | rtems-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/fat_file.h')
-rw-r--r-- | cpukit/libfs/src/dosfs/fat_file.h | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/cpukit/libfs/src/dosfs/fat_file.h b/cpukit/libfs/src/dosfs/fat_file.h index 79af62a398..b162d8a0fd 100644 --- a/cpukit/libfs/src/dosfs/fat_file.h +++ b/cpukit/libfs/src/dosfs/fat_file.h @@ -88,6 +88,7 @@ typedef struct fat_file_fd_s fat_dir_pos_t dir_pos; uint8_t flags; fat_file_map_t map; + time_t ctime; time_t mtime; } fat_file_fd_t; @@ -139,6 +140,22 @@ fat_construct_key( ((pos->ofs >> 5) & (FAT_DIRENTRIES_PER_SEC512 - 1)) ); } +static inline void fat_file_set_ctime(fat_file_fd_t *fat_fd, time_t t) +{ + fat_fd->ctime = t; +} + +static inline void fat_file_set_mtime(fat_file_fd_t *fat_fd, time_t t) +{ + fat_fd->mtime = t; +} + +static inline void fat_file_set_ctime_mtime(fat_file_fd_t *fat_fd, time_t t) +{ + fat_fd->ctime = t; + fat_fd->mtime = t; +} + /* Prototypes for "fat-file" operations */ int fat_file_open(fat_fs_info_t *fs_info, @@ -192,6 +209,26 @@ void fat_file_mark_removed(fat_fs_info_t *fs_info, fat_file_fd_t *fat_fd); +int +fat_file_size(fat_fs_info_t *fs_info, + fat_file_fd_t *fat_fd); + +int +fat_file_write_first_cluster_num(fat_fs_info_t *fs_info, + fat_file_fd_t *fat_fd); + +int +fat_file_write_file_size(fat_fs_info_t *fs_info, + fat_file_fd_t *fat_fd); + +int +fat_file_write_time_and_date(fat_fs_info_t *fs_info, + fat_file_fd_t *fat_fd); + +int +fat_file_update(fat_fs_info_t *fs_info, + fat_file_fd_t *fat_fd); + #ifdef __cplusplus } #endif |