mirror of
https://github.com/RGBCube/serenity
synced 2025-07-24 01:47:36 +00:00
Kernel: Try to set [cm]time in Inode::did_modify_contents
This indirectly resolves a fixme in sys$msync
This commit is contained in:
parent
10d9bb93be
commit
c3e57bfccb
2 changed files with 6 additions and 1 deletions
|
@ -232,6 +232,12 @@ void Inode::did_remove_child(InodeIdentifier, StringView name)
|
||||||
|
|
||||||
void Inode::did_modify_contents()
|
void Inode::did_modify_contents()
|
||||||
{
|
{
|
||||||
|
// FIXME: What happens if this fails?
|
||||||
|
// ENOTIMPL would be a meaningless error to return here
|
||||||
|
auto time = kgettimeofday().to_truncated_seconds();
|
||||||
|
(void)set_mtime(time);
|
||||||
|
(void)set_ctime(time);
|
||||||
|
|
||||||
m_watchers.for_each([&](auto& watcher) {
|
m_watchers.for_each([&](auto& watcher) {
|
||||||
watcher->notify_inode_event({}, identifier(), InodeWatcherEvent::Type::ContentModified);
|
watcher->notify_inode_event({}, identifier(), InodeWatcherEvent::Type::ContentModified);
|
||||||
});
|
});
|
||||||
|
|
|
@ -600,7 +600,6 @@ ErrorOr<FlatPtr> Process::sys$msync(Userspace<void*> address, size_t size, int f
|
||||||
// FIXME: Handle MS_ASYNC
|
// FIXME: Handle MS_ASYNC
|
||||||
TRY(inode_vmobject.sync(offset / PAGE_SIZE, rounded_size / PAGE_SIZE));
|
TRY(inode_vmobject.sync(offset / PAGE_SIZE, rounded_size / PAGE_SIZE));
|
||||||
// FIXME: Handle MS_INVALIDATE
|
// FIXME: Handle MS_INVALIDATE
|
||||||
// FIXME: If msync() causes any write to a file, the file's st_ctime and st_mtime fields shall be marked for update.
|
|
||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue