20 while (!stopToken.stop_requested())
23 unsigned int nBytes = 0;
26 spdlog::error(
"Failed to get available events for file monitoring: {}",
getErrnoString(errno));
29 auto buffer = std::vector<char>(nBytes + 1,
'\0');
31 if (nRead < 0 && errno != EAGAIN)
33 spdlog::error(
"Failed to read events for file monitoring: {}",
getErrnoString(errno));
37 spdlog::debug(
"No events read for file monitoring");
43 const auto *
event = std::bit_cast<inotify_event *>(&buffer[
static_cast<size_t>(idx)]);
52 idx +=
static_cast<ssize_t
>(
sizeof(inotify_event) +
event->len);