This commit is contained in:
Your Name
2024-04-27 03:14:01 -05:00
parent f5ba304cd6
commit f23e5441b5
56 changed files with 3319 additions and 36416 deletions

11
common/watchdog.cc Normal file
View File

@@ -0,0 +1,11 @@
#include <string>
#include "common/watchdog.h"
#include "common/util.h"
const std::string watchdog_fn_prefix = "/dev/shm/wd_"; // + <pid>
bool watchdog_kick(uint64_t ts) {
static std::string fn = watchdog_fn_prefix + std::to_string(getpid());
return util::write_file(fn.c_str(), &ts, sizeof(ts), O_WRONLY | O_CREAT) > 0;
}