26 #ifndef FSW_KQUEUE_MONITOR_H 27 # define FSW_KQUEUE_MONITOR_H 32 # include <sys/stat.h> 33 # include <sys/event.h> 41 struct kqueue_monitor_load;
77 void initialize_kqueue();
78 void terminate_kqueue();
79 bool scan(
const std::string& path,
bool is_root_path =
true);
80 bool add_watch(
const std::string& path,
const struct stat& fd_stat);
81 bool is_path_watched(
const std::string& path)
const;
82 void remove_deleted();
83 void rescan_pending();
84 void scan_root_paths();
85 int wait_for_events(
const std::vector<struct kevent>& changes,
86 std::vector<struct kevent>& event_list);
87 void process_events(
const std::vector<struct kevent>& changes,
88 const std::vector<struct kevent>& event_list,
93 kqueue_monitor_load *load;
void * context
Pointer to context data that will be passed to the monitor::callback.
Definition: monitor.hpp:542
Base class of all monitors.
Definition: monitor.hpp:146
Main namespace of libfswatch.
Definition: event.cpp:23
Header of the fsw::monitor class.
virtual ~kqueue_monitor()
Destroys an instance of this class.
void run()
Executes the monitor loop.
kqueue_monitor(std::vector< std::string > paths, FSW_EVENT_CALLBACK *callback, void *context=nullptr)
Constructs an instance of this class.
Solaris/Illumos monitor.
Definition: kqueue_monitor.hpp:48
std::vector< std::string > paths
List of paths to watch.
Definition: monitor.hpp:522
FSW_EVENT_CALLBACK * callback
Callback to which change events should be notified.
Definition: monitor.hpp:537
void FSW_EVENT_CALLBACK(const std::vector< event > &, void *)
Function definition of an event callback.
Definition: monitor.hpp:60