1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 19:57:35 +00:00

LibCore: Stub out FileWatcher for Lagom platforms

Stub out the FileWatcher class with ENOTSUP stubs to let Services that
require it to compile for Lagom. Later we should add real code for this
using techniques like Linux's inotify(7).
This commit is contained in:
Andrew Kaster 2022-07-04 10:01:01 -06:00 committed by Andreas Kling
parent 1f5cef1319
commit 73742176a4

View file

@ -206,6 +206,30 @@ FileWatcher::~FileWatcher()
dbgln_if(FILE_WATCHER_DEBUG, "Stopped watcher at fd {}", m_notifier->fd());
}
#else
// FIXME: Implement Core::FileWatcher for linux, macOS, and *BSD
FileWatcher::~FileWatcher() { }
FileWatcher::FileWatcher(int watcher_fd, NonnullRefPtr<Notifier> notifier)
: FileWatcherBase(watcher_fd)
, m_notifier(move(notifier))
{
}
ErrorOr<NonnullRefPtr<FileWatcher>> FileWatcher::create(InodeWatcherFlags)
{
return Error::from_errno(ENOTSUP);
}
ErrorOr<bool> FileWatcherBase::add_watch(String, FileWatcherEvent::Type)
{
return Error::from_errno(ENOTSUP);
}
ErrorOr<bool> FileWatcherBase::remove_watch(String)
{
return Error::from_errno(ENOTSUP);
}
#endif
}