From 73742176a45fe7e754e054e4ff96e0a273f39624 Mon Sep 17 00:00:00 2001 From: Andrew Kaster Date: Mon, 4 Jul 2022 10:01:01 -0600 Subject: 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). --- Userland/Libraries/LibCore/FileWatcher.cpp | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) (limited to 'Userland/Libraries') 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) + : FileWatcherBase(watcher_fd) + , m_notifier(move(notifier)) +{ +} + +ErrorOr> FileWatcher::create(InodeWatcherFlags) +{ + return Error::from_errno(ENOTSUP); +} + +ErrorOr FileWatcherBase::add_watch(String, FileWatcherEvent::Type) +{ + return Error::from_errno(ENOTSUP); +} + +ErrorOr FileWatcherBase::remove_watch(String) +{ + return Error::from_errno(ENOTSUP); +} + #endif } -- cgit v1.2.3