diff options
author | Andrew Kaster <akaster@serenityos.org> | 2022-07-04 10:01:01 -0600 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2022-07-06 14:24:23 +0200 |
commit | 73742176a45fe7e754e054e4ff96e0a273f39624 (patch) | |
tree | 5e6eb02c44b99a2b7a08d52613494628ba5eeefa | |
parent | 1f5cef13197c05467e24304538cb17759640a173 (diff) | |
download | serenity-73742176a45fe7e754e054e4ff96e0a273f39624.zip |
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).
-rw-r--r-- | Userland/Libraries/LibCore/FileWatcher.cpp | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/Userland/Libraries/LibCore/FileWatcher.cpp b/Userland/Libraries/LibCore/FileWatcher.cpp index 1c0cc3f131..63334d7406 100644 --- a/Userland/Libraries/LibCore/FileWatcher.cpp +++ b/Userland/Libraries/LibCore/FileWatcher.cpp @@ -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 } |