vfs: add modification time member to directory_service

Issue #1784.
This commit is contained in:
Josef Söntgen
2019-03-20 15:01:34 +01:00
committed by Christian Helmuth
parent 400039e1b6
commit 9a82bbb54d
7 changed files with 117 additions and 1 deletions

View File

@ -462,6 +462,7 @@ class Vfs::Dir_file_system : public File_system
out.gid = 0;
out.inode = 1;
out.device = (Genode::addr_t)this;
out.modification_time = { Vfs::Timestamp::INVALID };
return STAT_OK;
}

View File

@ -160,6 +160,7 @@ struct Vfs::Directory_service : Interface
unsigned gid = 0;
unsigned long inode = 0;
unsigned long device = 0;
Timestamp modification_time { Timestamp::INVALID };
};
enum Stat_result { STAT_ERR_NO_ENTRY = NUM_GENERAL_ERRORS,

View File

@ -172,6 +172,20 @@ struct Vfs::File_io_service : Interface
virtual bool queue_sync(Vfs_handle *) { return true; }
virtual Sync_result complete_sync(Vfs_handle *) { return SYNC_OK; }
/***********************
** Modification time **
***********************/
/**
* Update the modification time of a file
*
* \return true if update attempt was successful
*/
virtual bool update_modification_timestamp(Vfs_handle *, Vfs::Timestamp)
{
return true;
}
};
#endif /* _INCLUDE__VFS__FILE_IO_SERVICE_H_ */

View File

@ -49,6 +49,12 @@ namespace Vfs {
using Genode::Interface;
using Genode::String;
struct Timestamp
{
static constexpr long long INVALID = (1LL << 63) + 1;
long long value;
};
typedef Genode::Path<MAX_PATH_LEN> Absolute_path;
}