sys_fs_fsync implemented

sys_fs_fdatasync implemented as equal function
This commit is contained in:
Nekotekina 2017-04-24 18:43:27 +03:00
parent 19fd8c109e
commit 256dfc5729
6 changed files with 76 additions and 21 deletions

View file

@ -60,7 +60,8 @@ namespace fs
{
virtual ~file_base();
virtual stat_t stat() = 0;
virtual stat_t stat();
virtual void sync();
virtual bool trunc(u64 length) = 0;
virtual u64 read(void* buffer, u64 size) = 0;
virtual u64 write(const void* buffer, u64 size) = 0;
@ -206,6 +207,13 @@ namespace fs
return m_file->stat();
}
// Sync file buffers
void sync() const
{
if (!m_file) xnull();
return m_file->sync();
}
// Read the data from the file and return the amount of data written in buffer
u64 read(void* buffer, u64 count) const
{
@ -488,11 +496,6 @@ namespace fs
{
}
stat_t stat() override
{
fmt::raw_error("fs::container_stream<>::stat(): not supported");
}
bool trunc(u64 length) override
{
obj.resize(length);