event/InotifyEvent: new class wrapping inotify

Replaces class InotifySource.
This commit is contained in:
Max Kellermann
2022-06-30 11:27:13 +02:00
parent ff4cf6c6d1
commit 0f4bf5569a
12 changed files with 301 additions and 230 deletions
-12
View File
@@ -44,7 +44,6 @@
#ifdef __linux__
#include <sys/eventfd.h>
#include <sys/signalfd.h>
#include <sys/inotify.h>
#endif
#ifndef O_NOCTTY
@@ -283,17 +282,6 @@ FileDescriptor::CreateSignalFD(const sigset_t *mask) noexcept
return true;
}
bool
FileDescriptor::CreateInotify() noexcept
{
int new_fd = inotify_init1(IN_CLOEXEC|IN_NONBLOCK);
if (new_fd < 0)
return false;
fd = new_fd;
return true;
}
#endif
bool
-1
View File
@@ -209,7 +209,6 @@ public:
#ifdef __linux__
bool CreateEventFD(unsigned initval=0) noexcept;
bool CreateSignalFD(const sigset_t *mask) noexcept;
bool CreateInotify() noexcept;
#endif
/**